C
Constantin Gavrilescu
I'm using the code from the example
http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/index.html for the
http/net library:
File.open('result.txt', 'w') {|f|
http.get('/~foo/') do |str|
f.write str
end
}
This works fine for html files. But for binary files the result is a
corrupted file.
I've run this in the console:et('/crocodil2/adrian.mp3') {|str|f.write str}}}
=> #<Net::HTTPOK 200 OK readbody=true>
The mp3 files is corrupted. It does not seem to be base64 encoded...
help please.
http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/index.html for the
http/net library:
File.open('result.txt', 'w') {|f|
http.get('/~foo/') do |str|
f.write str
end
}
This works fine for html files. But for binary files the result is a
corrupted file.
I've run this in the console:et('/crocodil2/adrian.mp3') {|str|f.write str}}}
=> #<Net::HTTPOK 200 OK readbody=true>
The mp3 files is corrupted. It does not seem to be base64 encoded...
help please.