Permission issues in the directory of the user. How to reset permissions?

Asked

Viewed 806 times

0

I have a problem in my briefcase /media/tmp/ and /media/catalog/product/ of the Gento. When trying to upload the images of the products in the creation of the product, the image is sent to the website but does not appear in the image listing of the products as shown in the image below.

I know why it happens but I can’t fix it.

Both in the temporary directory and in the definitive directory, the image receives permission 640 when it is played in the folder and should receive permission 644. When I use the magento-cleanup.php, everything goes back to normal because the script simply resets all existing folder and file permissions.

inserir a descrição da imagem aqui

1 answer

1

Open the following file: lib/Varien/File/Uploader.php Find this line:

    chmod($destinationFile, 0640);

Replace 640 with 644, so:

    chmod($destinationFile, 0644);

Find this other line:

 if (!(@is_dir($destinationFolder) || @mkdir($destinationFolder, 0750, true))) {

Replace 750 with 755, so:

 if (!(@is_dir($destinationFolder) || @mkdir($destinationFolder, 0755, true))) {

Now just go to your Magento admin panel and Upload a new image to see.

Previously uploaded images that are not showing, should have the manually changed permissions.

Source: https://www.secnet.com.br/blog/imagem-do-produto-nao-aparece

Browser other questions tagged

You are not signed in. Login or sign up in order to post.