Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fahimbabarpatel/7941ca2c3e0236788052 to your computer and use it in GitHub Desktop.
Save fahimbabarpatel/7941ca2c3e0236788052 to your computer and use it in GitHub Desktop.
require 'open-uri'
require 'aws-sdk'
Aws.config.update({
region: 'us-west-2',
credentials: Aws::Credentials.new('akid', 'secret'),
})
s3 = Aws::S3::Resource.new
bucket = s3.bucket('bucket_name')
folder = 'folder_1/inside_folder_of_folder_1/'
obj = bucket.object(folder+'test.mp3') // add proper extension
obj.put(body: open(link).read)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment