I have a source of PDF file base64 encoded.
This is source: http://pastebin.com/embed_iframe/Lz8Zyfq7
I want to save file with base64_decode. But I can not properly save the PDF file. Generated and decoded PDF file looks empty. It is not 0 KB.
$fileContent = base64_decode($base64EncodedSource);
$fileName = "temp.PDF";
header('Content-Type: application/pdf');
header('Content-Length: '.strlen( $fileContent ));
header('Content-disposition: inline; filename="' . $fileName . '"');
header('Cache-Control: public, must-revalidate, max-age=0');
header('Pragma: public');
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
echo $fileContent;
How can I fix this issue?