Location – PHP – File Upload

I send the file for download in this way:

   $mp4url = "http://www.site.tv/video.mp4";
header('Location: '.$mp4url);

Chrome redirects to the file address. How can he get it to download to the computer instead of playing in the browser?


Answer 1, authority 100%

Modify HTTP Headers (Examples)


Answer 2, authority 100%

then as an option for you: through the php function that saves files (I forgot how it is), save the file on your server, and then use my function to force download from your server

Forced File Download


Answer 3

Try writing in .htaccess:

AddType application/octet-stream .mp4

Answer 4

this is all configured on the client side, nothing can be changed on the server, except to send it as an archive