Instantiating File from a remote url in a rails controller
Is there a way to have something like this:
File.开发者_如何学编程new('http://hostname/myfile.zip')
inside a controller?
require 'open-uri'
file = open(URI.parse('http://www.google.com/intl/en_ALL/images/logo2.gif'))
puts file.size
=> 8558
精彩评论