Hi guys,
I have a database where files are stored as base64 chunks.
I’d like to have the possibility of saving down a specific file from a PHP page, but I just can’t get it right.
The Gzip file is created with the Testfile.pdf in it, but when opening the pdf it’s broken.
What am I missing? Here’s my code:
[php]$Base64Chunks = "H4sIAAAAAAAAAIx7A3QlbZd1bJudGzu5sTq2bXds………………”;
$Filename = “Testfile.pdf.gzip”;
$data = utf8_encode(base64_decode($Base64Chunks));
$gzdata = gzencode($data, 9);
$fp = fopen($Filename, “wb”);
fwrite($fp, $gzdata);
fclose($fp);[/php]
Thanks in advance!