I also found this on a php site, sets a bunch of headers that forces
you to download a file, you may want to experiment with some of these.

header("Pragma: public"); // required
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false); // required for certain browsers
header("Content-Type: $ctype");
// change, added quotes to allow spaces in filenames, by Rajkumar Singh
header("Content-Disposition: attachment;
filename=\"".basename($filename)."\";" );
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($filename));
readfile("$filename");
exit();

On 8/8/07, Steven Ross <[EMAIL PROTECTED]> wrote:
> Why isnt your content type="audo/mpeg" ?
>
> http://www.w3schools.com/media/media_mimeref.asp
>
> I believe the only way to force the download window is through
> javascript... we had to do this on one app we built and it is
> extremely annoying because it depends on the user's browser settings
> and that is always hard to predict.
>
>
> -Steven
>
> On 8/8/07, Dusty Hale <[EMAIL PROTECTED]> wrote:
> >
> >
> > I've recently run into a rather strange issue with the use of cfcontent (I
> > think). Here is a description of what is happening:
> >
> > 1. cfcontent is used to serve downloadable audio and video files that reside
> > outside of the webroot. This of course is for security reasons being that
> > the users have to purchase the files. A common technique I've used
> > successfully in the past.
> >
> > 2. The files being downloaded don't seem to always come through complete and
> > it's almost like the download is being cut off for some reason. Sometimes it
> > works, sometime it doesn't.
> >
> > 3. It almost seems like client connectivity issues and I was convinced of
> > that until it started happening to me when testing and now user's of the
> > site report the same thing including the "client" (not client machine but my
> > client).
> >
> > 4. I used Adobe connect this morning to share screens with my client this
> > morning so I see hands on the problem on their computer and saw something
> > else really strange. She was clicking to download the file, the file open in
> > Windows Media rather than a normal download (I assume this was set up as her
> > default player for mp3 files). I asked her to right click and choose "Save
> > Target As" to ensure she was actually downloading it and not streaming it.
> > This always works fine for me but when she does that, it then downloads the
> > .cfm file rather than the mp3 file (I can't reproduce that on my machine).
> > She is using Windows 2000 OS.
> >
> > 5. The site is hosted on a shared server at HostMySite.com. HMS support
> > seemed to think the server it was on maybe was low on cf resources and that
> > cfcontent was putting together  bad files for downloads. Again sometime the
> > downloads work fine, sometimes they don't. We moved the site to a different
> > server they said had plenty of CF resources. However, this did not solve the
> > problem and it continues to happen on the new server
> >
> > I've now spent several days troubleshooting and am getting nowhere :(. If
> > someone has any insight as to why this might be happening, please share. I
> > think some discussions on the use of cfcontent for secure downloads is
> > probably a good topic for discussion anyway. Proper ways to successfully do
> > it?
> >
> > Last but not least here is a code example from my app:
> >
> > <cftry>
> >   <CFHEADER NAME="Content-Disposition" VALUE="inline;
> > filename=audio_#url.donorid#.mp3">
> >   <cfcontent
> > file="#application.path_audio##url.donorid#.mp3"
> > type="application/unknown">
> >   <cfcatch>
> >    <span style="color: red">There was a problem downloading the file. The
> > file name may be missing from the server.  Please alert the website
> > administrator.</span>
> >    <cfabort>
> >   </cfcatch>
> >   </cftry>
> >
> > Also one other thing. Is there a way to use cfcontent so that it forces an
> > audio or video file to actually download to a selected location. When user's
> > default media players are set up for mp3, it generally just opens the file
> > and starts playing. I want to somehow ensure that the file is fully
> > downloaded to a selected area (that the user selects) before they start
> > playing it and getting confused. In other words, a "normal download" file.
> > Hope that doesn't seem confusing.
> >
> > I greatly look forward to discussing and/or hearing any feedback on the
> > issue.
> >
> > Regards to everyone,
> >
> > Dusty
> >
> > -------------------------------------------------------------
> > Annual Sponsor - Figleaf Software
> >
> > To unsubscribe from this list, manage your profile @
> > http://www.acfug.org?fa=login.edituserform
> >
> > For more info, see http://www.acfug.org/mailinglists
> > Archive @
> > http://www.mail-archive.com/discussion%40acfug.org/
> > List hosted by FusionLink
> > -------------------------------------------------------------
>
>
> --
> Steven Ross
> web application & interface developer
> http://www.zerium.com
> [mobile] 404-488-4364
> [fax] 267-482-4364
>


-- 
Steven Ross
web application & interface developer
http://www.zerium.com
[mobile] 404-488-4364
[fax] 267-482-4364


-------------------------------------------------------------
Annual Sponsor FigLeaf Software - http://www.figleaf.com

To unsubscribe from this list, manage your profile @ 
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------



Reply via email to