Download resume with NET::HTTP
by Alex Dj other posts by this author
May 9 2008 7:19AM messages near this date
Form_remote_tag and csv download?
|
Re: Download resume with NET::HTTP
I'm wondering is there any way to do interrupt file download and then
resume it from the same spot?
The way I download file:
Net::HTTP.start("server.com") { |http|
response = http.request_get('/some/path') {|response|
file_length = response['Content-Length']
File.open('video.avi', 'w') {|f|
response.read_body do |str| # read body now
puts str.length
f.write str
end
}
}
}
I'm not using open-url as I found that open() method first downloads
whole file and then starts to write it. Not for me....
Cheers Alex
--
Posted via http://www.ruby-forum.com/.
Thread:
Alex Dj
Marcelo
Alex Dj
|