I went with this, modified from http://php.he.net/readfile docs example 1:

header('Content-Description: File Transfer');
header('Content-Type: '.$type);
header('Content-Disposition: attachment; filename='.basename($name));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: '.$size);
echo $data;

And it works in FF 3.0.10 and IE 7 and Safari 3.2.1.
I thought it would be some header magic.



Bastien,
I think because I was not urlencoding or not basenaming the filename,
it would come through as the name of the script if the name had a
space in it.  test.pdf actually came through with the name test.pdf.
But the real filenames are like "QUOTE Part 1-2 Prospect Name.pdf".

Thanks everybody.

I was looking up those other header names and case sensitivity when I
found the readfile example.  DebugBar reports a different case than
what I sent, so I thought that could be an issue too (like
Content-Length versus Content-length).  Moot for me now though.

Re-RTFM I guess.

Regards.

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

Reply via email to