开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜