wyc
wyc

Reputation: 55263

How to make a link downloadable by clicking the left mouse button?

In this page I have a button which says download:

http://www.brianfunshine.com/newest-company-narration-demo/

The problem is that it opens the song in the browser it doesn't download the song. How to solve that issue?

Upvotes: 4

Views: 1022

Answers (4)

Shef
Shef

Reputation: 45589

Try adding this to the top of your .htaccess file:

<FilesMatch “.(?i:(mp3))$”>
    <IfModule mod_headers.c>
        ForceType application/octet-stream
        Header set Content-Disposition attachment
    </IfModule>
</FilesMatch>

If you want to force download another type of file (say pdf?), just add it next to mp3, like this
<FilesMatch “.(?i:(mp3|pdf))$”>

Upvotes: 2

DreadPirateShawn
DreadPirateShawn

Reputation: 8402

Content-disposition is an extension to the MIME protocol that instructs a MIME user agent on how it should display an attached file.

http://support.microsoft.com/kb/260519

More specifically, it looks like "content-disposition: attachment; filename=[filename]" is what you want.

http://forums.iis.net/t/1162386.aspx

Upvotes: 0

love Computer science
love Computer science

Reputation: 1830

  • Right click on that button and
  • Click on save link as it will open a Save As Dialog Box,
  • Select ur location to save,
  • When Download is complete you will be able to play your song.

Upvotes: -4

bradley.ayers
bradley.ayers

Reputation: 38372

HTTP header Content-Disposition

Upvotes: 4

Related Questions