Revision: 22545
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at January 15, 2010 00:17 by cburyta
Initial Code
// pdfString is the *contents* of a file.
// to serve a file that exists on the file system, use readfile() instead of print $pdfString
header('Content-Description: File Transfer');
header('Content-Type: application/pdf');
header('Content-Length: ' . strlen($pdfString));
header('Content-Disposition: attachment; filename=' . 'pdf_dynamic.pdf');
ob_clean();
flush();
print $pdfString;
exit;
Initial URL
Initial Description
Quick basic way to serve a string or a file through PHP
Initial Title
Serve PDF file with PHP
Initial Tags
header, file
Initial Language
PHP