You guys are probably familiar with the IE bug that prevents the header function from properly loading a pdf file (details). So I'm screwing around with this for about an hour yesterday, trying to get a work-around, when I start reading down through the comments of others on the php.net page.
Somewhere buried down in there, someone had suggested this as a workaround:
$len = filesize($filename);
header('Content-type: image/jpeg');
header('Content-Length: $len');
header('Content-Disposition: inline; filename="filename.pdf"');
readfile($filename);
Sure enough, that little bugger works! (My code forces the download, but it still works like a dream). What I'm concerned about is what the ramifications are of using the above code to "fudge" the pdf file by tricking IE into thinking it is an image. Am I opening a can of worms somewhere? Anybody have any comments?