You asked the same question in a different thread yesterday. I'm not sure you
got my response though.
It sounds like you have people that are experiencing problems when trying to
download an MP3 file. Correct?
I do a lot with MP3's. This is the basics of the code I use to force the
browser to download the file.
It sets the Mime type so then the browser should know to offer opening the file
in a mp3 player or offer to download. Next it sets the filesize and offer that
up also so the browser can properly determine download size and time. It also
forces the browser to view the file as an Attachment instead of inline meaning
the browser will always know to try to download the file.
<cfparam name="url.filename" default="">
<cfif trim(url.filename) neq "">
<cfset filename = trim(url.filename)>
<cfset foldername = [my_mp3_file_path]>
<cfdirectory action="list" directory="#foldername#" filter="#filename#"
name="fileSize">
<cfheader name="Content-Disposition" value="Attachment;
filename=#filename#">
<cfheader name="Expires" value="#Now()#">
<cfheader name="Content-Length" value="#fileSize.size#">
<cfcontent type="audio/mp3" file="#foldername##filename#" deletefile="No">
</cfif>
I hope this helps solve the problem you are having.
Wil Genovese
One man with courage makes a majority.
-Andrew Jackson
A fine is a tax for doing wrong. A tax is a fine for doing well.
On May 8, 2010, at 7:15 AM, Rob Voyle wrote:
>
> Hi Folks
>
> I have a series of mp3 sound files on my website.
>
> I would like people to be able to download them to listen on their ipod or
> in their car on a cd etc.
>
> People are able to listen to them from the web but their ability to
> download and save them seems very variable. Some can see "save as" others
> can't. There is great variability between browsers and the media programs
> that people are using. Some mp3 files are able to be saved others aren't
> though I am not sure of any difference as I haven't set any specific
> permissions
>
> Is there a way to create saving permission for mp3 that all browsers/media
> players would recognize?
>
> Thanks
>
> Rob
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333528
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm