Jump to content


Photo

Passthru/Session incompatability


  • Please log in to reply
1 reply to this topic

#1 dthmtluncrn

dthmtluncrn
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 22 December 2003 - 08:50 PM

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!!!

#2 metalblend

metalblend
  • Members
  • PipPipPip
  • Advanced Member
  • 89 posts
  • LocationCalifornia, USA

Posted 22 December 2003 - 08:56 PM

See http://www.phpfreaks.../topic10214.php.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users