Hi,
I was writing a small script to download a binary file from a http
site....
require 'net/http'
http = Net::HTTP.new("www.cs.sunysb.edu/~dipanjan", 80,'proxy',8080)
local = File.new("prithibi.mp3", 'w')
http.request_get("/prithibi.mp3") do |response|
response.read_body do |chunk|
#print "writing chunk"
local.write(chunk)
end
end
local.close
Now, the file downloaded by this is different from the original (which
I managed to download using a download accelerator program). Size was
different and on opening it in a binary editor, immediately visible
was an extra byte (0D) at the 734th position.
Any ideas where these extra bytes are coming from? Do it need to
'chomp' my response chunks?
Regards,
Ashish