Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,162,765 members, 7,851,613 topics. Date: Thursday, 06 June 2024 at 12:48 AM

How To Force Android Browser To Download Media Files Instead Of Play/stream - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / How To Force Android Browser To Download Media Files Instead Of Play/stream (997 Views)

Why You Should Use HTTPS Instead Of HTTP On Your Website / How To Make Media Files Downloadable In Wordpress Instead Of Streaming / Google Adsense Now Bans Specific Blog Pages Instead Of Sites - 2017 New Policy (2) (3) (4)

(1) (Reply)

How To Force Android Browser To Download Media Files Instead Of Play/stream by wolex4luv(m): 5:18pm On Dec 28, 2015


Guess this shouldn't be strange to bloggers, that when a visitor/reader click the media link, such as mp4 or mp3 links (ex; http://www.brixcity.net/wp-content/uploads/2015/10/Brighter-Day-For-Nigeria.mp3), a new tab will open and play the music or video.


However, sometimes what people really wanted was to be able to download it and then play on their own device.

About more than 80 percent of people (even bloggers) do not know how to go about it, but the good news is here comes step-by-step guides that will see you through.

All you need to do is to insert the following code into your .htaccess file, which can be found in the root directory of your website.

NB: Before you do it, make sure you backup your .htaccess file first.


Step 1. Login To your control panel and navigate to your File manager Tab.



Step 2. Locate your .htaccess file in the root directory of your website.



Step 3. Edit the code as shown in the screen shot below,


Then place the following lines of code directly after the line 1 of your .htaccess file;

<FilesMatch "\.(?i:mp3)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>
<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>


So you have;


Finally, click on save!

There you have it, you can go ahead to download direct mp3/mp4 files using your android native browser.

If you love this tutorial, don't hesitate to share!


Source: http://www.brixcity.net/tech-how-to-force-android-browser-to-download-media-files-instead-of-playstream/

(1) (Reply)

Help Guys. I Need Assistance In Web Development / Please Review My New Blog's Design / Blog+10 Unique Contents+adsense Approval Trick

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 10
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.