Binary data is simply the actual file, or rather, the important contents of this file, without the file name.
$base64 = ; $binary = base64_decode($base64);
And there you have the file data / file contents in the $binary variable. From here, it depends on what you want to do. You can write the data to a file and you will get an โactualโ PDF file:
file_put_contents('my.pdf', $binary);
You can output the data to the browser with the appropriate header, and the user will receive something that looks like a PDF file:
header('Content-type: application/pdf'); header('Content-Disposition: attachment; filename="my.pdf"'); echo $binary;
deceze
source share