开发者

Rails send_data() send_file() problem

I have a paperclip attachment in one开发者_运维问答 model, but I`m not saving the file in /public, but /assets. And when the user what to open the file I use the send_data() function, which makes the user to download the file.

My question is how can I show the file in other way (not nessecery to download)? So if the file is a image, I will see it directly in the browser without download.

Thanks!


Try:

send_data foo, :disposition => 'inline'

This would tell the browser to just render the content, instead of prompting the user to save it.

… from http://apidock.com/rails/ActionController/Streaming/send_data

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜