Doyley
Doyley

Reputation: 321

Unable to upload product images after upgrading Magento

So a client came on board with a Magento site that hadn't been upgraded for years and were experiencing security issues. So we cleaned up their site and upgraded them to 1.9.2.4.

As I've been testing their system I've noticed that I cannot upload any new product images. All folder permissions are correct. When I try to upload the image it says "Upload complete" but the new image does not appear in the list. This affects new or current products.

So I did some digging. There is nothing in the server or Magento logs that would explain the issue. I went through the code step by step trying to figure out where it's falling down. So far I've discovered that the file is being uploaded to the /tmp directory. It is then correctly moved to the magento/media/tmp folder. After that nothing appears to happen.

Has anybody had this issue before? Any ideas what is going wrong?

Thanks

Upvotes: 0

Views: 1296

Answers (2)

Abhinav Kumar Singh
Abhinav Kumar Singh

Reputation: 2325

To fix this, a manual change is required on the file lib/Varien/File/Uploader.php to adjust the 0640/0750 permissions to 0644/0755.

To perform this fix, open the file: lib/Varien/File/Uploader.php Search for this line:

chmod($destinationFile, 0640);
Replace it with this line:
chmod($destinationFile, 0644); 

Search for this line:

chmod($destinationFile, 0750);
Replace it with this line:
chmod($destinationFile, 0755);

Save the file and refresh Magento’s cache. You should now be able to upload images correctly with permissions that the webserver can access.

Upvotes: 0

Doyley
Doyley

Reputation: 321

OK I solved it. Turns out somebody had tried to install the No Flash Image Uploader extension at some point and then deleted it, but not correctly. I removed all traces and it's working again.

Upvotes: 0

Related Questions