12345678910111213141516171819 |
- def upload_file_to_s3(file, bucket_name, acl="public-read"):
- try:
- s3.upload_fileobj(
- file,
- bucket_name,
- file.filename,
- ExtraArgs={
- "ACL": acl,
- "ContentType": file.content_type
- }
- )
- except Exception as e:
- print("Something Happened: ", e)
- return e
- return "{}{}".format(app.config["S3_LOCATION"], file.filename)
|