Reputation: 1
specify how to configure the server to the fact that he gave the mp4 file to load it in the G Chrome? When you click on the link downloads a file is opened in a browser that is not very acceptable. I was looking for ... They said that you must configure the header, but I do not quite understand where it needs to be done. It is also advised to change: application/file mp4; or remove this extension is quite mimetypes
I also tried:
location /files {
if ($request_filename ~* ^.*?/([^/]*?)$)
{
set $filename $1;
add_header Content-Disposition "attachment; filename=$filename";
}
}
, but nothing changed.
What to do? I'll be glad to any advice. Thank you.
I also know that mp4 files can be issued to the user for download, as implemented in savefrom.net
Upvotes: 0
Views: 1765
Reputation: 267
Set attribute "download" like
<a href='file.mp4' download='Very-Very-Good.mp4'>download</a>
Upvotes: 0
Reputation: 15036
I think you have a little bit wrong header Content-Disposition
add_header Content-Disposition "attachment; filename=\"$1\"";
Also you don't need set filename $1;
(with my example) it should be removed.
For me such method works fine.
Upvotes: 1