So I was working right along today, figured out what was wrong with my script that was allowing a user to inject a path into my URL and now I have this problem.
I have the following code in a php file to download a PDF file to a client's computer. Problem is that it doesn't work in Firefox 1.0 (I assume legacy versions are this way too).
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header('Content-Description: File Transfer');
header('Content-Type: application/pdf');
header('Content-Length: ' . filesize($filename));
header('Content-Disposition: attachment; filename=' . basename($file));
readfile($file);
I have also changed the content-type to application/force-download and application/octet-stream.
None of the three work in FF. This code works in IE 6 (naturally), Safari and IE 5.3 on Mac OS X.
Anyone have any idea why it's like that in Firefox?