kmn*_*mnd 4 ruby-on-rails download resume-download
我试图让我的Rails应用程序支持恢复下载,因为我们从那里提供相当大的文件.我很久以前发现了一块中间件,但是我再也找不到了.关于如何将其拉下来的任何提示/技巧?
谢谢!:)
这就是我做到的:
response.header["Accept-Ranges"] = "bytes"
send_file product.pack.path, :type => product.pack_content_type, :x_sendfile=>true
Run Code Online (Sandbox Code Playgroud)
我问我们服务器的人设置mod_xsendfile,我不知道如何设置它自己.
教程:http://www.devsource.com/c/a/Techniques/Resumable-File-Downloads-with-ASPNet/2/
在这里阅读内容长度:http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13
关于流媒体可在此处获取:http://api.rubyonrails.org/classes/ActionController/Streaming.html
| 归档时间: |
|
| 查看次数: |
1710 次 |
| 最近记录: |