Author Topic: Force File Downloads???  (Read 2788 times)

mrsdpoag

  • Newbie
  • Posts: 2
Force File Downloads???
« on: April 06, 2009, 05:00:16 am »
I am using Blubrry PodPress on Wordpress 2.7.1.   I am using enclosures to add mp3 audio podcasts to my posts.  I have enabled the download link for each post, but the mp3 plays instead of opening a download box.  Could someone advise me on how to force the user to download the file instead of it opening up and playing?

Thanks!

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Force File Downloads???
« Reply #1 on: April 06, 2009, 11:16:37 am »
I don't recommend changing this behavior as leaving the browser to decide which media player to use is the preferred way to handle media download links. If you need an example why you don't want to change this, try downloading the media from an iPhone or Google G1 phone with the following steps below to see how doing something like this inconveniences users.

The most efficient way to do this is to upload the media file to another directory on your web server then create a .htaccess file, change the content-type of the media (e.g. audio/mp3) and set the content type to binary/octet-stream. This will make most browsers display a "File Save As" dialog.

Example .htaccess file:

    AddType  application/octet-stream .mp3

Again I don't recommend doing this, but this is what you can do if you're so inclined to do so.


mrsdpoag

  • Newbie
  • Posts: 2
Re: Force File Downloads???
« Reply #2 on: April 06, 2009, 01:34:29 pm »
Thanks Angelo for the info! 

I am not understanding something though.  I had the same setup with a different webhost.  My blog used the PowerPress plugin - my posts had buttons to play the post on the page, or on a new page, and a button if the user preferred to download the podcast and save it to their computer.  Now, new hosting company but same setup, only now the download button plays the file rather than allowing the user to download, even though in my settings, I have enabled the file download option.  My site is: http://newsongky.com/podcasts.

What am I missing?

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Force File Downloads???
« Reply #3 on: April 07, 2009, 08:38:49 am »
Your not missing anything, your other hosting company didn't have the content type set for mp3 so users saw a file save as dialog. The behavior you want is non-standard.

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Force File Downloads???
« Reply #4 on: December 11, 2014, 04:22:49 pm »
Just an update on this subject, Chrome, Firefox and Opera support the download attribute, which is built into PowerPress download links. IE is considering adding this feature to Internet Explorer. They are prioritizing features based on public voting. I strongly encourage everyone who cares about this issue to go to the following link and place as many votes as you can (up to 3 I believe) for this feature to be added in future versions of IE.

IE download attribute voting: https://wpdev.uservoice.com/forums/257854-internet-explorer-platform/suggestions/6261278-a-download-attribute