GuidePedia

0
It is somehow irritating when you click on a media file to download it,instead of it to take you to the download page it takes you to the online streaming platform of the file .

So far the browser can be able to detect the file extension it will surely take you to the streaming page.

By default,this is what wordpress blogs do,instead of taking you to the download page it will take you to the streaming page.

Quick Way To Force Download Media Files (mp3, mp4) On WordPress Photo credit | http://portalprogramas.com

In today's stroll am going to show you the quick way to force download media Files (mp3, mp4) on wordPress by adding a single code in your .htaccess and as you might have guessed,this article is really useful for entertainment bloggers

To force download Mp3 files on wordpress blogs all you have to do is to add this line of code below in the end of your .htaccess.
<FilesMatch ".(?i:mp3)$"> ForceType application/octet-stream Header set Content-Disposition attachment </FilesMatch>

And that's all,whenever a user clicks to download a file,if the file has an extension of .mp3 then a download dialogue box will be shown to the user.

To force download other files like flv,mp3,3gp, all you have to do is just repeat the step above and add this code below:
<FilesMatch ".(?i:mp3)$"> ForceType application/octet-stream Header set Content-Disposition attachment <FilesMatch ".(?i:mp4)$"> ForceType application/octet-stream Header set Content-Disposition attachment </FilesMatch> <FilesMatch ".(?i:mpg)$"> ForceType application/octet-stream Header set Content-Disposition attachment </FilesMatch> <FilesMatch ".(?i:mov)$"> ForceType application/octet-stream Header set Content-Disposition attachment </FilesMatch> <FilesMatch ".(?i:flv)$"> ForceType application/octet-stream Header set Content-Disposition attachment </FilesMatch>

And thats all... I hope this post really helped? Feel free to ask any question that is related to this in the comment box below.

Post a Comment

Let's hear what you have to say.

 
Top