Andrea and Ashley,
Thanks ladies.

Originally, IE claimed that the server wasn't even there (with that
wacky IE error).  I was lacking headers (which was fine for 6 years

The code below is consistent across the 3 browsers I tried (Safari,
FF, IE).  However, it converts spaces to underscores.  I'm keeping
this code:
header('Content-Description: File Transfer');
header('Content-Type: '.$type);
header('Content-Disposition: attachment;
filename='.basename(str_replace(' ', '_', $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;

If I use
header('Content-Disposition: attachment; filename="'.basename($name).'"');
of the 3 browsers tested, only IE will replace spaces with
underscores.  Safari and FF pass through correctly.  But I'll go with
consistency and avoid the "if browser-war" clauses.

Thanks all.

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to