E D R S I H C RSS
ID
Password
Join
His heart was yours from the first moment that you met.

FrontPage SaveImageFileFromWeb

No older revisions available



# save image from web
# 2011. 1. 7

require 'open-uri'

def read_url_file(url_name_, number_)
    open(url_name_) { |from| $data = from.read }
    File.open("#{number_}.jpg", "wb:binary") { |to| to.write($data) }
end

read_url_file("http://chobocho.com/photo/sydney.jpg", 2)
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2011-01-08 02:07:02
Processing time 0.0385 sec