Resuming File Downloads in Ruby on Rails

Posted by jaycode on Stack Overflow See other posts from Stack Overflow or by jaycode
Published on 2010-05-19T06:29:24Z Indexed on 2010/05/20 8:00 UTC
Read the original article Hit count: 341

Hi, this has been asked here:

http://stackoverflow.com/questions/1840413/resuming-file-downloads-in-ruby-on-rails-range-header-support

But there was no answer. I am having similar problem, could anybody help, please?

Thanks before.

Alright I am getting close. Seems like I need to setup header Content-Length or Content-Range, as described here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13.

Haven't got an idea how. Anybody knows?

Jay

response.header["Content-Range"] = "20000-#{size}"
send_file "#{Dir.pwd}/products/filename.zip", :type => 'application/zip', :size => (size - 20000)

doesn't work

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about resume-download