duanjiao5723 2018-04-26 17:52
浏览 44
已采纳

Cakephp:将字符串变量下载为文件

Is it possible to do download a string variable in my code as a file with cakephp ?

For example:

$myString = "value1;value2;value3 1;2;3";

I want to download the string $myString as a csv file without saving it on my server. I just want the user to be able to download the string as a file.

If you have regular php solutions, It can do the job but I prefer to use CakePHP.

Thanks for your help,

Antoine

  • 写回答

2条回答 默认 最新

  • drwo2014 2018-04-27 05:06
    关注

    You have tagged this question with cakephp 2.0

    As burzum points out they have an example exactly for this use case of yours here

    Sending a string as a file

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?