Resuming File Downloads in Ruby on Rails
- by jaycode
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