Help with download button which prompts user to save file

  • kshines_01
  • Born
  • Born
  • No Avatar
  • Joined: Jul 13, 2010
  • Posts: 4
  • Status: Offline

Post July 13th, 2010, 7:13 am

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
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post July 13th, 2010, 7:13 am

  • Toolbox
  • Novice
  • Novice
  • No Avatar
  • Joined: Apr 07, 2010
  • Posts: 24
  • Loc: CyberSpace
  • Status: Offline

Post July 13th, 2010, 11:50 pm

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
  • No Avatar
  • Joined: Jul 13, 2010
  • Posts: 4
  • Status: Offline

Post July 14th, 2010, 3:28 pm

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
  • No Avatar
  • Joined: Apr 07, 2010
  • Posts: 24
  • Loc: CyberSpace
  • Status: Offline

Post July 14th, 2010, 3:57 pm

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
  • No Avatar
  • Joined: Jul 13, 2010
  • Posts: 4
  • Status: Offline

Post July 15th, 2010, 6:40 am

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
  • No Avatar
  • Joined: Mar 28, 2009
  • Posts: 305
  • Loc: AFK
  • Status: Offline

Post July 15th, 2010, 7:39 am

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.
Custom Web Design
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8926
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Online

Post July 15th, 2010, 7:54 am

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.
Ozzu Hosting - Want your website on a fast server like Ozzu?

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 150 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.