[snip]
Header("Content-Disposition: attachment; filename=".$fileName);
@readfile($fileName);
}
?>
This still has a glitch. If you click open on the dialog box, a second box opens then you can click open and the PDF will open in the viewer. Post a fix if you have one.
===============
That was actually what this thread was all about :p
The Content-Disposition header should look like this, it will remove the annoying first popup in IE :
Header("Content-Disposition:$attachment filename=".$fileName);
Note the $attachment instead of ' attachment;', for some unknown reason IE 5.X shows extra popups if you add ' attachment ;' to the Content-Disposition header. If you leave it out however, IE 5.X works as it should (but then Netscape no longer works :p). That's why I tried to fix things by checking if the user is using an MSIE browser.
BTW Has anyone tested the hack on MSIE 4.X or 6.X? If so, does it work on these versions too, or should the hack only be applied to MSIE 5.X?