by
82k 39
1
6
2,691
0
Top 1% !
Popular
Famous
Tagged
Specified
OpenSource
Popularity: 6283rd place
LanguagePython
LicenseMIT_X11
MacOS Version10.7.5
OSMac OS X

Upload a file into a S3 bucket in Python

Uploading a local file into S3 using the Boto library is pretty simple. 
In this example we upload the localFilepath into a destS3Name location in the destBucket.
Here is the snippet:
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/11179/Upload-a-file-into-a-S3-bucket-in-Python?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
s3Link = S3Connection() s3Bucket = s3Link.get_bucket(destBucket) newItem = s3Bucket.new_key(destS3Name) newItem.set_contents_from_filename(localFilepath)
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus