Get a file from a URL : open uri « Network « Ruby
- Ruby
- Network
- open uri
Get a file from a URL
require 'open-uri'
f = open('http://www.rubyinside.com/test.txt')
puts "The document is #{f.size} bytes in length"
f.each_line do |line|
puts line
end
Related examples in the same category