lizardmedia / product-attachments-magento2

Magento2 module for adding downloadable product attachments
MIT License
40 stars 37 forks source link

Can't download the attached file #26

Closed FrancescoTalotta closed 4 years ago

FrancescoTalotta commented 4 years ago

Hello,

when I try to download the file I attached, I get this error:

"Sorry, there was an error getting requested content."

Francesco

bartoszkubicki commented 4 years ago

Please make sure you have correct file permissions on your server. Today after updating module to the newest version I have tested downloading and it was ok.

FrancescoTalotta commented 4 years ago

Hello,

thank you for your reply. What do you mean by file permission? Do I have to check and set it with chmod and chwon or do I have to set something in the Magento admin panel?

Thank you

Francesco

bartoszkubicki commented 4 years ago

No, check if catalog where files are placed are readable and writeable - you may not copy your file into target directory (pub/media/downloadable) or you may not read them. In admin you can try clicking on uploaded file (when product is saved) and check if here you can download them

FrancescoTalotta commented 4 years ago

Hello, in the admin panel I can't open the files neither. In the pub/media/downloadable I checked and I have the file there, although the permission by default is www-data:www-data and -rw-rw-r--. I tried to change it as my_username:www-data and -rwxrwxr-x but it does not work. Same error messages.

bartoszkubicki commented 4 years ago

@FrancescoTalotta I am sorry but today module has been tested by QA team, on store we are developing right now and there was no problem like this. I can't reproduce this issue. If I were you I would turn on xdebug and would find the exact place where exception occured and I would try to deduct why it's thrown.

mushketer888 commented 3 years ago

Got such issue. fixed with chmod 777 /var/www/html/

bartoszkubicki commented 3 years ago

@FrancescoTalotta @mushketer888 777 is not a good idea. You should configure your permissions according to https://devdocs.magento.com/guides/v2.4/config-guide/prod/prod_file-sys-perms.html. Check paragraph "Make code files and directories writable", and pub/media is among directories that should be writable.