MilesWeb Hosting Forum

Web Hosting Main Forums => Ecommerce Hosting & Discussion => Topic started by: Administrator on February 02, 2016, 12:12:37 PM

Title: Images uploaded via Magento admin have incorrect permissions
Post by: Administrator on February 02, 2016, 12:12:37 PM
Hi All,

When you upload the image via Magento admin panel, it might be that the images are not getting displayed and a thumbnail does not gets created. When you try to browse the image using a valid link it shows 404 Not Found Error.

The images gets uploaded under your account & you can view it using File Manager as well. If you have a close look at the file permissions, you will notice that the permissions on files is set to 640. With these permissions you won't be able to browse the images and that is the reason thumbnails are not getting generated and neither it does show the images in products.

This is due to the permission set when files are uploaded is incorrect in lib/Varien/File/Uploader.php. Simply open the file which should be under the root directory of your magento installation.

Quote# vi lib/Varien/File/Uploader.php

Look for

Quotechmod($destinationFile, 0640);

Set it to

Quotechmod($destinationFile, 0644);

Save the file & exit.

When you upload the images and products now, correct permissions will be set on the images and it will generate the thumbnails as well as show the product images.

QuoteLooking for quality Magento hosting? Look no further than MilesWeb's Best Magento Hosting (https://www.milesweb.com/magento-hosting.php) plans.