Help with download button which prompts user to save file

  • kshines_01
  • Born
  • Born
  • kshines_01
  • Posts: 4

Post 3+ Months Ago

I am looking to add a download button to my site that prompt users to save the file (mp3) once they click the button, any suggestions?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Toolbox
  • Novice
  • Novice
  • Toolbox
  • Posts: 24
  • Loc: CyberSpace

Post 3+ Months Ago

Slap together a button in photoshop and then add the hyperlink to the mp3 file :P

the browser will confirm the file download
  • kshines_01
  • Born
  • Born
  • kshines_01
  • Posts: 4

Post 3+ Months Ago

I have the button created, when I hyper link it to the mp3 file it opens up a page and plays it.
  • Toolbox
  • Novice
  • Novice
  • Toolbox
  • Posts: 24
  • Loc: CyberSpace

Post 3+ Months Ago

Why not have it in a rar file, compress it down and link it.

Then explain that all downloads are in rar form to prevent corruption and less time downloading lalala

under that have rarlabs web site details so people without rar can download the free software

Now you will save disk space, traffic and made the downloading a little safer from holding the content within the rar

can't see a issue with that :)
  • kshines_01
  • Born
  • Born
  • kshines_01
  • Posts: 4

Post 3+ Months Ago

I need to make it as simple as possible for the people who will be using it. Having them unzip something is going to be way too much for them.
  • natas
  • PHP Ninja
  • Proficient
  • natas
  • Posts: 308
  • Loc: AFK

Post 3+ Months Ago

Is there a possibility that you could use the above solution, and instruct users to "right-click, save as".

I will check more into this today.
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9088
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

If you are on an Apache based server and have access to using a .htaccess file to override Apache directives, this solution may work. In your .htaccess file add something like this:

APACHE Code: [ Select ]
AddType application/octet-stream .mp3


This is one way you can try to force a download instead of it automatically trying to play. If that does not work you can also try putting this in your .htaccess file:

APACHE Code: [ Select ]
<Files *.mp3>
ForceType application/octet-stream
Header set Content-Disposition attachment
</Files>
  1. <Files *.mp3>
  2. ForceType application/octet-stream
  3. Header set Content-Disposition attachment
  4. </Files>


If you can do the above it should work for most browsers, although I think it may still not work correctly with IE due to the fact that IE does not handle the Content-Disposition correctly. If you try the above test it out in multiple browsers and let us know your results.

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 41 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.