Re: IE5.5 Header Issues

From: Date: Wed, 03 Jan 2001 20:10:00 +0000
Subject: Re: IE5.5 Header Issues
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-32543@lists.php.net to get a copy of this message
Hey all, I am completely stumped now. I've tried everyone's suggestions and it still doesn't work in IE. However, every suggestion works fine in Netscape. Here is the code I started with: <?php if (isset($source) && isset($filename)) { if (filetype($source) == "text/plain") header("Content-Type: text/plain"); else header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=$filename"); header("Content-Length: ".filesize($source)); readfile($source); exit(); } ?> I then tried this code: <?php if (isset($source) && isset($filename)) { header("Content-Type: ".filetype($source)); header("Content-Disposition: attachment; filename=$filename"); header("Content-Length: ".filesize($source)); readfile($source); exit(); } I've also tried this code: <?php if (isset($source) && isset($filename)) { header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=$filename"); header("Content-Length: ".filesize($source)); readfile($source); exit(); } ?> The actual URL I'm sending looks like this: http://www.domain.com/download.popup.php/filename.ext?source=%2Fwww%2Fclient 2%2Ffiles%2Factualfilename.ext&filename=filename.ext I am running this on Apache Linux. I am testing with IE5.5. I get the download dialog every time, which asks if I want to save the file as the filename "index.html". I have tried every suggestion that has been given to no avail. I don't know what element I'm missing. If someone has some actual code that works for this situation it might shed some light on what I'm doing wrong. I would just use an actual download link, but some of the files that will be downloaded through this method in the future will be generated on the fly and the issue will surely come back to haunt me. I really appreciate the help guys. Thanks, Toby ----- Original Message ----- From: "jeremy brand" <jeremy@nirvani.net> To: "Philip Hallstrom" <philip@oddjob.adhesivemedia.com> Cc: <tmiller@creativegeneration.com>; <php-general@lists.php.net> Sent: Wednesday, January 03, 2001 1:43 PM Subject: Re: [PHP] IE5.5 Header Issues > > /normal/path/to/url?foo=bar&fake=filename.ext > > > > ? It might trick IE into thinking that the filename it should be saved > > as is "filename.ext" > > I can verify that if IE notices the .ext it will try and handle it > ignoring any mime types that you bothered to set. > > > Or if you can use PATH_INFO instead of a query string and do something > > like this: > > > > /normal/path/to/phpfile.php/filename.ext > > > > That would then set PATH_INFO equal to "/filename.ext" > > > > I don't see how IE would know not to save it as filename.ext in this > > case. (you'd think anyway :) > > There is supposadly a work around. I saw it fly by the list about 3 > weeks ago. It is a custom Content-type: header that IE understands > that has a recommended filename accociated with it. It is not in any > HTTP RFC, but I think it is possibly part of another one. > > I don't have time to dig it up, but the answer is out there, try > searching the list archives. > > Jeremy > > Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: jeremy@nirvani.net > http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for > more > Get your own Free, Private email at http://www.smackdown.com/ > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > "<body>" -- Quoted from Yahoo! homepage, Hû}lµoÐ_¼ > §}“ÿ;ßhttp://www.yahoo.com > > > > > -philip > > > > In article <00a401c0759f$6c623840$13011eac@tmiller> you write: > > >I do want it to prompt the user to download I just want it to prompt the > > >user with the filename that's specified, not "index.html" for every > > >requested download. It works in Netscape 4 and 6, but not in IE5. I've also > > >tested it now in IE4, but that doesn't really count since Microsoft has > > >already announced that it won't work properly there, but they claim that it > > >does in IE5. Any other suggestions? > > > > > >----- Original Message ----- > > >From: "Blaster" <blaster@videotron.ca> > > >To: "Toby Miller" <tmiller@creativegeneration.com>; > > ><php-general@lists.php.net> > > >Sent: Wednesday, January 03, 2001 9:30 AM > > >Subject: RE: [PHP] IE5.5 Header Issues > > > > > > > > >> The line: > > >> header("Content-Disposition: attachment; filename=$filename"); > > >> is to prompt the browser to download the file... So if you don't want the > > >> browser to prompt for a file download, don't put it > > >> > > >> -----Original Message----- > > >> From: Toby Miller [mailto:tmiller@creativegeneration.com] > > >> Sent: Wednesday, January 03, 2001 09:19 > > >> To: php-general@lists.php.net > > >> Subject: [PHP] IE5.5 Header Issues > > >> > > >> > > >> I am using the following code: > > >> > > >> <?php > > >> > > >> if (isset($source) && isset($filename)) { > > >> if (filetype($source) == "text/plain") header("Content-Type: > > >> text/plain"); > > >> else header("Content-Type: application/octet-stream"); > > >> > > >> header("Content-Disposition: attachment; filename=$filename"); > > >> header("Content-Length: ".filesize($source)); > > >> readfile($source); > > >> exit(); > > >> } > > >> > > >> ?> > > >> > > >> This does not work properly in IE 5.5. I don't have another version of IE > > >to > > >> test this with. I get a save dialog box for the file "index.html" every > > >> time. This is the same for all file types. Is this just a bug in IE 5.5 or > > >> is this the same in other versions of IE? If anyone knows the workaround I > > >> would love to see it. > > >> > > >> Thanks, > > >> Toby > > >> > > >> > > >> > > >> -- > > >> PHP General Mailing List (http://www.php.net/) > > >> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > >> For additional commands, e-mail: php-general-help@lists.php.net > > >> To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > > > >-- > > >PHP General Mailing List (http://www.php.net/) > > >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > >For additional commands, e-mail: php-general-help@lists.php.net > > >To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#32543) next »