Created
June 13, 2018 05:08
-
-
Save shiro01/ef83faf76e7fbc4b98152ae823eb8f89 to your computer and use it in GitHub Desktop.
save file to s3 bucket
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
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