client = boto3.client('s3')
bucket_name = 'api_reports'
resp = client.put_object(
Bucket= bucket_name,
Key= filename,
Body= file,
Expires= datetime.utcnow() + timedelta(days=7), )
print(resp)
url = client.generate_presigned_url(
'get_object',
Params = {
'Bucket': bucket_name,
'Key': filename, },
ExpiresIn = 86400, )
print(url)
Last active
April 18, 2017 00:57
-
-
Save philographer/ef2e8b610f7c9eb2a573c7069e0e46bd to your computer and use it in GitHub Desktop.
Python S3 Upload by Boto
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
보안 설정
~/.boto
[s3] use-sigv4 = True