How to export a Base64 string to a file, on server side, without saving it in web server, directly by PHP?

后端 未结 1 1352
余生分开走
余生分开走 2020-12-21 15:52

I am using PHP and MySQL for my programming.


I have stored some Base64 strings (which are encoded from files

相关标签:
1条回答
  • 2020-12-21 16:40

    Try adding headers to the script before echoing the output

    header('Content-Description: File Transfer');
    header("Content-type: application/octet-stream");
    header("Content-disposition: attachment; filename= ".$file."");
    echo base64_decode($file);
    
    0 讨论(0)
提交回复
热议问题