Magento – magento image filename auto renaming

importmagento-1.9media-imagesproduct-images

i sell products that come in variations. i upload image into media/import, and after the 1st product on csv file, magento create duplicate image file and renames it like below for the other products that have same image filename as 1st product on csv. i have products that come in 60-70 variations, so this is filling storage qquickly, how can i fix this?

enter image description here

Best Answer

By default Magento added this check as if same file exist then rename it because there may be possibility admin can upload different image with same name.

So as your requirement you need to do some code level change:

Step1: Copy file

app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php

to your local code pool as

app/code/local/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php

Step2: search for function uploadAction() & find line $uploader->setAllowRenameFiles(true); & then change to $uploader->setAllowRenameFiles(false);

Now try uploading csv now. It should work.

Related Topic