How to force mp4 download






















This is a simple technique that forces the download as browsers are unable to read a zip file. The majority of your users will know that they will need to open this file to then receive their downloadable content. Adding some code to your. The following example demonstrates the code that you would need to add to force PDF files to download:. Some file examples include: mp3, mp4 and doc. The example below displays how you can force the download of multiple different files including: mov, mp3, jpg and pdf.

If you are storing your files to your Amazon S3 account instead of your server then you can complete the following to ensure a force download of those files takes place. Set the correct headers on your files in Amazon S3 in order to force the browser to download rather than opening the file. You will need to set them when uploading the files to S3.

If you have your downloadable item stored in a drop-box account, there is a way to ensure this item is always forced to download when a user clicks on it. See the example below for the correct positioning of this parameter:.

Your email address will not be published. Save my name, email, and website in this browser for the next time I comment. When to Force a Download and Why If you are offering a large item, even if this is a pdf it is recommended to force this download. How to Force a File Download If you wish for all your downloadable content to be automatically saved on your visitors computer complete one of the following options depending on your developer knowledge and website needs : Option 1 to Ensure Items are Forced to Download: Zip File Zip File Example Encapsulating your downloadable items in a zip file will ensure they are forced to download.

See if you can get the htaccess to work with what you're trying to do I guess. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Force download mp4 files Ask Question. Asked 8 years, 10 months ago. Active 8 years, 10 months ago. Viewed 16k times. Omid Kamangar 5, 9 9 gold badges 37 37 silver badges 67 67 bronze badges. Ben Ben 1, 10 10 gold badges 28 28 silver badges 43 43 bronze badges. Add a comment. Active Oldest Votes. If you can use htaccess Works great! Community Bot 1 1 1 silver badge. Eric Eric 7 7 silver badges 13 13 bronze badges. Maybe the user is not using Apache!

Sorry Eric, I was writing the comment before you edited your answer. Ako hey, no problem, I know the asker was looking for a PHP solution, just thought I would throw htaccess out there and hope it would stick.

Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password.



0コメント

  • 1000 / 1000