SK
Asked
Hello, Everything is working fine so far.
However, when I am trying to download the files (png, jpg) I have attached in the invoice, it's giving me 404 Not found error and can't download the files.
This is the link.
https://wujukorea.com/admin/welcome/download/74f159c08ac7ae322ae73a9cf8a4635d.png
Do you know what could be causing this?
However, when I am trying to download the files (png, jpg) I have attached in the invoice, it's giving me 404 Not found error and can't download the files.
This is the link.
https://wujukorea.com/admin/welcome/download/74f159c08ac7ae322ae73a9cf8a4635d.png
Do you know what could be causing this?
- MSAnsweredHello,
I can't check your server. I can only check the item, if having issue. You will need to check with your server admin for any server config/issue.
I am not saying you to delete the `location /` but the following
```
location ~ /files {
deny all;
return 404;
}
```
I am suspecting this. - SKAnsweredI did that and still not working.
And also, I am running multiple websites with PHP Scripts, none of them have this problem.
Did you even check the item? - MSAnsweredHello,
**_You can check it on live demo. Your download and demo are exact same._**
There are more than thousand people using the item and if the issue is with item code, every one should have it not only you. I am sure it's not the item code as I have tested it after your question but still try to help.
If you have removed the file, you need to restart the nginx and test.
Thank you - SKAnsweredI did removed the file, and restarted the nginx and tested, still, when downloading the attachments, i am getting 404 and when even trying to delete the attached file, i am getting 'ajax call fail'
- MSAnsweredHello,
I am sorry if I was not clear. It's not about paid support. You are supported and we will try our best to help.
The issue here is some nginx config and we are not good with server management. We use third-party software to manage servers. You can check ploi.io or laravel forge. I think ploi offer 1 server free account too.
I have check the route and links, download attachment is working but I have no clue why your nginx showing 404. The ajax call issue is due to same reason. Your server admin might help to check the cause.
Thank you - EGAnsweredThose on nginx server can add this code to their nginx config **nginx.conf**
```
location /admin/welcome/download/ {
alias /var/www/wwwroot/files/;
add_header Content-disposition "attachment";
}
```
***OR***
Replace attachment function in `core.js` file via `themes\default\admin\assets\js\core.js`
with the function below
```
function attachment(x) {
return x == null || x == 0
? ''
: x == 1
? '<div class="text-center"><i class="fa fa-check"></i></div>'
: '<div class="text-center"><a href="' +
'files/' +
x +
'" target="_blank" class="tip" title="' +
lang.download +
'"><i class="fa fa-file"></i></a></div>';
}
``` - MSAnswered**[Enyinnaya Gift](/u/giftedhands4real)** Thank you for sharing. The first solution seems fine. If the access if denied to files, the second option will get the same error. Won't it?
- EGAnsweredNo, it won't. It will open the file in a new browser tab.
I did test both options on a client's Nginx server having the same reported issue and it works fine.
I kind of even prefer the second option. - MSAnswered**[Enyinnaya Gift](/u/giftedhands4real)** Hello,
Does the nginx config has
```
location ~ /files {
deny all;
return 404;
}
```
It should allow direct access, if it is blocking for php OR the issue might be different as I think :(
Thanks for the solution - Login to Reply