Hello, how to download XLSX that was converted to base 64?
File returns empty.
I got:
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Cache-Control: must-revalidate');
header('Expires: 0');
header('Pragma: public');
header('Content-Disposition: attachment; filename="' . $fileName.'.'.$fileExtension . '"');
echo $file;
if (ob_get_contents() || ob_get_length()) {
ob_end_clean(); //or ob_end_flush();
}
exit();
rpkamp
December 3, 2018, 1:43pm
2
if the contents of $file
is base64 encoded you should change echo $file
to echo base64_decode($file);
1 Like
rpkamp:
base64_decode
I tried that that is the same
$file
comes from curl soap call (WSDL) and it seem to be already decodes (saying that as images works already without base64_decode
)
We would need to see where $file
comes from, since the problem seems to be with that variable.
1 Like
system
Closed
March 4, 2019, 9:13pm
5
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.