requre ‘open-uri’
open(“output_filename.jpg”, “w”) { |outfile|
outfile.write open(“http://image_url.jpg”) { |inf|
ifile.read
}
}
Oops … naming problem with inf and ifile … both should be infile.
Could it be at all possible that a class has just been set an exercise
of downloading an image from a webserver, and the class notes also
pointed to the existence of the ruby-talk mailing list?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.