Download a File from a URL without displaying it?

mattnz

Member
Registered
Joined
Jul 16, 2016
Messages
48
Points
8
I have files with the format as SWF, a PNG or an MP3 or somthings, instead of displaying them on Google Chrome, I want to directly download the files to my PC. Sometimes this also happened on Firefox browser but I can not figure out how to make them work as what I wanted. There is a way to do this? I just can't find it by googling and need your tricks.
 

LJSHost

Well-known member
Hosting Provider
Registered
Joined
Jul 5, 2016
Messages
1,031
Points
63
You can create lines of code in your .htaccess file of your server to force a download of a particular file type from the server (in this example it is for mp3 file types):

Code:
<FilesMatch "\.(?i:mp3)$">
  ForceType application/octet-stream
  Header set Content-Disposition attachment
</FilesMatch>
 
Older Threads
Replies
1
Views
3,681
Replies
2
Views
2,903
fwh
Replies
4
Views
3,949
Newer Threads
Replies
8
Views
5,383
Replies
16
Views
39,882
Replies
4
Views
4,662
Recommended Threads
Replies
22
Views
9,881
Replies
7
Views
5,064
Replies
38
Views
18,268
Replies
10
Views
6,532
Replies
1
Views
3,815

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top