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条)

报告相同问题?

悬赏问题

  • ¥100 网页游戏在本地页面修改游戏结果
  • ¥30 comfyui openpose报错
  • ¥20 Wpf Datarid单元格闪烁效果的实现
  • ¥15 图像分割、图像边缘提取
  • ¥15 sqlserver执行存储过程报错
  • ¥100 nuxt、uniapp、ruoyi-vue 相关发布问题
  • ¥15 浮窗和全屏应用同时存在,全屏应用输入法无法弹出
  • ¥100 matlab2009 32位一直初始化
  • ¥15 Expected type 'str | PathLike[str]…… bytes' instead
  • ¥15 三极管电路求解,已知电阻电压和三级关放大倍数