Force download file in CakePHP 2.1

北慕城南 提交于 2020-01-14 06:14:31

问题


I am using force download component to get download the file.

I want to show success flash message on the same page once the user accept it to save otherwise want to show an error message on that page.

First thing, Is it possible to track the save dialog event (not confirmed if it is) and if it is then how I can achieve it?


回答1:


This link might help you. You can open the new tab after submitting the form. And use $this->autoRender = false; at the end of your controller's action and use force download component to download the requested file.




回答2:


Open it in a new tab and use your force download component.



来源:https://stackoverflow.com/questions/11338343/force-download-file-in-cakephp-2-1

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!