开发者

rails send_file with nginx

I am trying to send a file via send_file, in rails 3... The file is found and is seemingly sent too, but for some reason it is not received...

Also even though :disposition => 'inline' is set, the browser always shows a "download box"...

In nginx conf, sendfile is set to on...开发者_运维问答


I had the same problem, I looked at the response headers and saw the response type was being set as application/octet-stream. Try setting the file's mime type when calling send_file

send_file file, :disposition => 'inline', :type => 'image/png'


I suggest you should go through this: Serving Large Files Through Nginx via Rails 2.3 Using x-sendfile

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜