import boto3
s3 = boto3.client( "s3", aws_access_key_id= "*************", aws_secret_access_key="**********" )
@login_blueprint.route('/uploadfile', methods=['POST'])
file= request.files['file']
try:
filename = secure_filename(file.filename)
acl="public-read"
s3.upload_fileobj( file, 'bucket-name', file.filename, ExtraArgs={ "ACL": acl, "ContentType": file.content_type } )
except Exception as e:
resp = jsonify(e)
resp.status_code =200
return resp
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)