Created
November 21, 2013 01:58
-
-
Save mikelopez/7574840 to your computer and use it in GitHub Desktop.
Download binary file through HTTP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open-uri' | |
File.open("/my/local/path/sample.flv", "wb") do |saved_file| | |
# the following "open" is provided by open-uri | |
open("http://somedomain.net/flv/sample/sample.flv", 'rb') do |read_file| | |
saved_file.write(read_file.read) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment