Re: content type header for downloading files

From: Date: Thu, 30 Jan 2003 01:04:13 +0000
Subject: Re: content type header for downloading files
Groups: php.general 
Request: Send a blank email to php-general+get-133573@lists.php.net to get a copy of this message
$fname is the name of the file i want to download. It works in IE, as in the name of the file to be downloaded appears correctly in the dialog box. I changed 'application/octet' to 'application/octet-stream' and this had no effect. Dara ----- Original Message ----- From: Chris Shiflett <shiflett@php.net> Date: Wed, 29 Jan 2003 06:47:17 -0800 (PST) To: Dara Dowd <daradowd@campus.ie>, php-general@lists.php.net Subject: Re: [PHP] content type header for downloading files > --- Dara Dowd <daradowd@campus.ie> wrote: > > I have the following headers in download.php which forces > > a download dialog box to be opened when a user clicks on > > a desired file: > > > > header("Content-type: application/octet"); > > header("Content-Length: $filelength"); > > header("Content-Disposition: attachment; > > filename=".basename($fname).";"); > > > > This works fine with IE, but Mozilla adds a '.php' > > extension to the filename if i choose the save option, > > and asks me to choose which application to use if I want > > to open the file. > > What is the value of $fname? If you are trying to tell it > the name of your script, then that is why Mozilla names it > so. The filename directive should be the filename you want > assigned to whatever you are sending the browser. > > Also, I think you mean to say application/octet-stream, but > I don't feel like looking it up. I suggest double-checking > that value. > > Chris -- For the largest free email in Ireland (25MB) & File Storage space (20MB), visit http://www.campus.ie Powered by Outblaze

« previous php.general (#133573) next »