Re: Serving out a file to Firefox ... headers?

From: Date: Fri, 24 Nov 2006 19:54:11 +0000
Subject: Re: Serving out a file to Firefox ... headers?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-245129@lists.php.net to get a copy of this message
On Thu, November 23, 2006 10:40 pm, Brian Dunning wrote: > Sorry to revisit this issue YET ONE MORE TIME... :) :) > > My online store sends out the file for download upon purchase. Below > are the headers I send, and I understood that it should work for all > browsers. It does not work for Firefox. Suggestions? > > header('Content-Type: application/octet-stream'); > header('Content-Disposition: attachment; filename='.$filename); This header is a bogus MS made-up header that "extends" the HTTP spec, and will not work for anything but IE, and only kinda sorta works on IE anyway... Well, IE itself only kinda sorta works, but that's another topic or twenty. :-) Here is a rather long-winded rant on this very topic: http://richardlynch.blogspot.com You may be able to find a short and more concise version elsewhere. OTOH, you may find the rant entertaining, as some have. > $size = filesize('../../store/files/'.$filename); > header('Content-Length: '.$size); > readfile('../../store/files/'.$filename); -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#245129) next »