Keyword

Understanding how updating 'attachments' works

  • nick
  • nick's Avatar Topic Author
  • Offline
  • Junior Member
More
7 years 7 months ago #157368 by nick
I sell files online and use K2store. K2store uses the K2 attachment as the file to sell, so I need to understand what K2 does with attachments because I have to update all the files.
What is the best way to update existing files but still have them available to existing purchasers so they can download the new file:
1. Delete the old file and replace it with the new file using the same name
2. Delete the old file and replace it with a new file using a new name
3. Upload the new file with a new name, but keep the old file as well
4. Another suggestion

Any help to understand how K2 references attachments would be greatly appreciated.

Thanks, Nick

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 7 months ago #157375 by Krikor Boghossian
Replied by Krikor Boghossian on topic Understanding how updating 'attachments' works
If I understand correctly you are selling digital files and you have multiple versions.

I would approach this a bit different.
Since the new attachments by default are placed on the bottom of the list. Use the attachment's title to clearly state the version or the release's info. When you publish a new version there would be no need to remove the old file.

You can also use the "Link title attribute (optional)" (<?php echo K2HelperUtilities::cleanHtml($attachment->titleAttribute); ?>) field in your template in order to display more info on that release.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • nick
  • nick's Avatar Topic Author
  • Offline
  • Junior Member
More
7 years 7 months ago #157380 by nick
Thank you Krikor.
Your suggestion is similar to my number 3 option.
There is one detail I left out. When someone buys a file (with K2Store), that file can automatically be emailed to the buyer (there is an option to also download the same file).
If there are two files (the original file and the new file) which of the files will be made available to the buyer for emailing? If as you suggest,

new attachments by default are placed on the bottom of the list

then the original file will be emailed, not the new file. Is that correct?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 7 months ago #157384 by Krikor Boghossian
Replied by Krikor Boghossian on topic Understanding how updating 'attachments' works
This is specific to K2 Store.
I do not know the exact specifics of this extension - content wise at least.
You need to contact the extension's developer about this question.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • nick
  • nick's Avatar Topic Author
  • Offline
  • Junior Member
More
7 years 7 months ago #157405 by nick
Thank you.
In that case to keep things simple, I will delete the original file and replace it with the new one.
Does it matter what I name the new file? For example does K2 need exactly the same name to reference the new file correctly, or does K2 find the correct attachment no matter what the name is?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 7 months ago #157412 by Krikor Boghossian
Replied by Krikor Boghossian on topic Understanding how updating 'attachments' works
If you delete the file and create a new attachment, then a new link will be created.

For the sake of clarity (and maintenance) you can use the same filename as before but the link will be created none the less.

The tricky part is, that I do not know how K2Store treats attachments and digital files and their associations.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum