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
2,520
Replies
2
Views
2,274
fwh
Replies
4
Views
3,037
Newer Threads
Replies
8
Views
4,363
Replies
16
Views
34,208
Replies
4
Views
3,580

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