dthmtluncrn Posted December 22, 2003 Share Posted December 22, 2003 Originally I posted this in the php help, but no one seems to have any answeres so here is the original post: Hi, Im having some problems with the passthru function. When I just have the passthru fuction like this header( \'Content-Type: application/pdf\' ); header( \'Content-Location: /local/relateive/pathname/agian/correct.pdf\' ); $fh = fopen(\"/correct_fullSystemPathname/yep/double/checked.pdf\", \"r\"); fpassthru($fh); This is the only thing in my file. When I add the session start session_start(); header(\"cache-control: private\"); at the beggining where it belongs, the passthru ceases to work. Instead of bringing up the pdf in the browser, like it was doing before the sessions, it asks for a download. However when you select to download it just says it is unable to open from the web site. It appears its trying to open the php file rather than letting the server \"serve the output\" of the php file. Ok any help would be greatly appreciated. Addition: Continuing to play with this thing I have found that the correct file is being called, and the download is initiallizing correctly... in fact by tricking the browser I could actually view the binary for the pdf that was being passed. The problem must be in the way the file is being presented. Probably some header I am missing. Any Ideas? Thanks for any help!!! Quote Link to comment https://forums.phpfreaks.com/topic/1542-passthrusession-incompatability/ Share on other sites More sharing options...
metalblend Posted December 22, 2003 Share Posted December 22, 2003 See http://www.phpfreaks.com/forums/topic10214.php. Quote Link to comment https://forums.phpfreaks.com/topic/1542-passthrusession-incompatability/#findComment-5066 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.