How to download a temporary file

后端 未结 4 1363
执念已碎
执念已碎 2021-02-05 05:49

I\'m trying to create a short PHP script that takes a JSON string, converts it to CSV format (using fputcsv), and makes that CSV available as a downloaded .csv file

4条回答
  •  渐次进展
    2021-02-05 06:20

    Firstly, check this string out, i would change it to:

    header('Content-Disposition: attachment; filename="'.basename($tmp).'"');
    

    i had the problem with it once, with browser compatibility :)

提交回复
热议问题