Re: [PHP] Serving out a file to Firefox ... headers?

2006-11-24 Thread Richard Lynch
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?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Serving out a file to Firefox ... headers?

2006-11-23 Thread Brian Dunning

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);
$size = filesize('../../store/files/'.$filename);
header('Content-Length: '.$size);
readfile('../../store/files/'.$filename);

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Serving out a file to Firefox ... headers?

2006-11-23 Thread Travis Doherty
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);
 $size = filesize('../../store/files/'.$filename);
 header('Content-Length: '.$size);
 readfile('../../store/files/'.$filename);

Pretty sure Richard already squared this one away, I think this is the
article you are looking for:

http://richardlynch.blogspot.com/

Travis

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php