Hi,
I've been using the phppdflib class to generate PDFs on the fly. They appear in the browser using Acrobat reader or download (depending how the user's browser is set up). However, I would like the option to save these PDFs on the server for later reference. I know it's something to do with fopen(), fput()/fwrite() etc., but I've so far been unsuccesful.
Here's the final bit of code that generates the pdf:
header("Content-Disposition: filename=magicletter.pdf");
header("Content-Type: application/pdf");
$temp = $pdf->generate();
header('Content-Length: ' . strlen($temp));
echo $temp;
and this is what I've tried to save the file:
$fr = fopen('/magicletter.pdf', 'w');
fwrite($fr, $temp);
fclose($fr);
This currently produces nothing at all!!
Any help/pointers greatly appreciated.🙂