Skip to main content

Amazon S3 Plugin: DELETE in Hikashop Should Delete on S3

More
3 hours 12 minutes ago #100000229 by MSTACE
-- Browser(s) name and version -- : Chrome 155.0

The Amazon S3 plugin is working well.

Now is the time to discuss DELETING a downloadable product in the IMAGES AND FILES section of a product.

I normally don't give my clients FTP or server access. Experience has shown that this is a very bad idea.

But with downloadable products (PDFs, MP3s, etc.), clients sometimes need to update those files.
The problem is that deleting the FILES inside the product page does not delete the file from the server:  /home/[user]/public_html/media/com_hikashop/upload/safe

The duplicate files create strange filenames:  MusicA_82374896.pdf
That is confusing when the customer downloads the file. They think that something is wrong with it.

Now that we use Amazon S3 for the 'safe' resource, updating a product file is even more difficult.

A button to DELETE THE FILE (whether it is on the local server or S3) would be great.

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

More
1 minute ago #100000232 by nicolas
Hi,

HikaShop already deletes the file, on the server and on Amazon S3 alike, but only when the product is saved after the file was removed from it. The odd names such as MusicA_82374896.pdf come from the order of the steps: when the new file is uploaded while the old one is still there, a file with that name already exists in the safe folder (or in the bucket), so HikaShop adds a number to the new one rather than overwrite the old one. The old file is only deleted later, when the product is saved.

To replace a downloadable file and keep its name, do it in two steps:

1. In the product's files, click the delete icon of the old file and save the product. The file is then deleted from media/com_hikashop/upload/safe, or from your bucket when it is stored on S3.

2. Upload the new file and save again. It now gets the original name, since nothing uses that name any more.

Two things keep the old file in place even when it is removed from the product:

- the "Keep images after delete" setting in the HikaShop configuration (main tab): when it is on, HikaShop keeps all the files of deleted entries, images and downloadable files, both on the server and on S3. Turn it off if you want them deleted.

- another product still using the same file (for example a product created with the copy button, which shares the files of the original): the file is kept as long as one of them points at it.

The deletion on S3 when a file is removed from a product needs HikaShop 6.6.0 or newer.

The files that already have a number in their name can be cleaned the same way: remove them from the product, save, then upload the file again with its proper name.

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

Time to create page: 0.153 seconds
Powered by Kunena Forum