Jump to content

BULK DELETION OF IMAGES


ZOOM47

Recommended Posts

I wonder how many people realise that when you delete an item on Cubecart it doesn't automatically delete the image/s?

I often have 6 or 7 images per listing and each listing is a 'one off' as I never sell exactly the same item again and never use the same images again. Items that are sold are transferred into a Sold Items category where they stay for around 12 months for collector's reference,  and makes it easier for me if I am listing a similar item by editing the description.  I also labour under the impression that this helps my SEO.  Every few months I bulk delete the sold listings which are over 12 months old but until recently had not realised that this does not delete the images. 

Consequently I have thousands and thousands of images, going back more than 10 years in some cases which do not relate to any current listing nor will they be used for any listing in the future.  It seems that there is no way to bulk delete images when you delete listings. I believe that this is now hugely slowing down the speed of my website and it is certainly increasing the time it takes me to list an item. If anyone can provide help and guidance or suggestions it would be much appreciated.  I apologise if this subject has already been covered. I am running Cubecart 6.2.0.  Many thanks.

 

Link to comment
Share on other sites

Because CubeCart allows images to be associated to products on a many-to-many relationship, deleting an image may have unforseen consequences on other products.

Many images can be assigned to a product, and one image can be assigned to many products. Hence, many-to-many.

If a number of images are bulk deleted (via FTP), the admin would then need to visit the admin, Images, Update File List tab. This then removes the now-orphaned references from the Filemanager database.

Link to comment
Share on other sites

Having thousands or tens of thousands of image files in a single directory has been an issue for as long as CubeCart is around (although not specifically a CubeCart issue) and doesnt have any significant impact on front end website speed (MySQL can easily copy with hundreds of thousands or millions of records if the table is indexed and queries are written correctly) but does make the Admin Image Manager option unusable or extremely slow.  Better documentation or education of users to have multiple sub-directories would be best but it still wouldnt stop people from doing it !

There has been talk on here about a custom plugin to identify and delete orphaned images but it has never been written - maybe a utility could be added to core.  Care would have to be taken as images can obviously be embedded in to documents as well as being used for products / catgeories etc

Link to comment
Share on other sites

I came up with something to delete orphaned images using a combination of the database entries exported to MS access .

I believe I linked cubecart_filemanager to cubecart_image_index with MS access to then export only the image file names.

Once I had the file names, I created a dos batch file to copy this list of files from one folder to another. (locally)

And then ftp these back to the web site. (renaming my original images folder first for backup)

It's crude, and took some thinking about, but only took maybe an hour, and worked a charm.

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...