Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Commit 523e169

Browse files
committed
Change download file example code
1 parent 6bdef25 commit 523e169

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

video/rest/compositions/get-composition-media-file/get-composition-media-file.5.x.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Download the helper library from https://www.twilio.com/docs/ruby/install
22
require 'twilio-ruby'
33
require 'net/http'
4-
require 'open-uri'
54

65
# Find your credentials at twilio.com/console
76
# To set up environmental variables, see http://twil.io/secure
@@ -18,6 +17,8 @@
1817

1918
media_location = response.body['redirect_to']
2019
# For example, write the composition media to a local file
20+
response = Net::HTTP.get_response(URI.parse(media_location))
21+
2122
open('myFile.mp4', 'wb') do |file|
22-
file << File.open(media_location).read
23+
file.write(response.body)
2324
end

0 commit comments

Comments
 (0)