AjaxFileUpload return download panel when data is json

坚强是说给别人听的谎言 提交于 2019-12-06 12:07:53

I have the same problem in ruby on rails.

I noticed that the return header was "Content-Type: apllication/json" when I used this code...

render :json => {:error => "", :msg => data}

Then I tried to use the following instead...

render :text => {:error => "", :msg => data}.to_json

After that the return header was changed to "Content-Type: text/html", then the problem solved.

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