Skip to content

Instantly share code, notes, and snippets.

@shiro01
Created June 13, 2018 05:08
Show Gist options
  • Save shiro01/ef83faf76e7fbc4b98152ae823eb8f89 to your computer and use it in GitHub Desktop.
Save shiro01/ef83faf76e7fbc4b98152ae823eb8f89 to your computer and use it in GitHub Desktop.
save file to s3 bucket
file_name = 'test.txt'
bucket_name= 'bucket-name'
bucket_dir = 'bucket-dir'
file_path = '/tmp/' + file_name
key = bucket_dir + file_name
s3bucket = boto3.resource('s3').Bucket(bucket_name)
s3bucket.upload_file(file_path, key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment