Hi There,
I have spent over an hour searching for something that works so I appreciate your patience. BTW the browser I'm using is IE6
Trying to force a download, here is the code that I'm using:
$filename="$DOCUMENT_ROOT/pdf/AP20030817W.pdf";
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"AP20030817W.pdf\"");
header("Content-transfer-encoding: binary\n");
header("Content-length: " . filesize($filename) . "\n");
fread("$filename");
The problem is that the first dialog message that comes up is "You are downloading the file dl12.php from mysite.com" -- The actual file attachment is a PDF, and as you can see I have named it.
However when I click Save, the name AP20030817W.pdf IS the suggested name, so it still works out OK. However, it's still irritating getting the wrong file name, and a lot of in-the-know people will notice this.
I have looked for OVER AN HOUR trying to overcome this. Can anyone give me a tip?
Thanks,
Sam Fullman