Answer the question
In order to leave comments, you need to log in
Can there be problems when uploading static files via Nginx?
There is one site with photos, users often download photos, photos were previously opened via a link адрес_сайта/photo-time.jpg
. As for me, it’s not very convenient for users, because new tabs are constantly opening, and they download sooooo much, they have to go to the tab, save the picture and close it, in general, unnecessary actions ...
Now I made a return of statics to the star for downloading if a GET request адрес_сайта/photo-time.jpg?download=1
is sent. When you click on the link, the picture immediately goes to download, which is very convenient, but in the Yandex web wizard I came across a user who clicked and clicked on the photo in the hope of downloading it and it looks like it didn't work.
The following rule is written in Nginx
In the main location I catch the GET request download=1 and redirect to @download
location @download {
add_header Content-disposition "attachment; filename=$image_name";
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question