Keyword

Different Items with the Same Attachment

  • BruHow
  • BruHow's Avatar Topic Author
  • Offline
  • New Member
More
13 years 6 months ago #94915 by BruHow
Hi, I am wanting to have several items with various content, but I want them each to have the same attachment. Then if I make updates to that attachment, it will be changed in multiple articles (items). Any idea how to do this?

Please Log in or Create an account to join the conversation.

More
13 years 6 months ago #94916 by william white
Replied by william white on topic Different Items with the Same Attachment
attachments are held in root/media/k2/attachments

when you upload a file to the first item its name is the same as you chose from your local machine

when you upload the same file to another item its name is the same_1.extension

so, if you use the upload to put the files there it will not work.

if you look in the table with phpmyadmin you will see that the table jos_k2_attachments contains a file name and also an itemid that it links to, so you can attach multiple files to a single item.

if you dont have many attachments like this you might be able to attach a dummy file, and then edit the table and change the file name and it may work.

it wasnt designed this way, and the core would need to be hacked to change this.

Please Log in or Create an account to join the conversation.

  • BruHow
  • BruHow's Avatar Topic Author
  • Offline
  • New Member
More
13 years 6 months ago #94917 by BruHow
Replied by BruHow on topic Different Items with the Same Attachment
Thank you for the thoughtful reply. I wonder...you said "when you upload the same file to another item its name is the same_1.extension" does it make this new name assignment by checking the database for the name first, or does it look in the folder? If the latter, could I not just move the file out of there temporarily when I upload the second item?

 

Now that I think of it, didn't I see a setting somewhere where you can specify to overwrite the existing file or use a new name? Would this work across items you think?

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum