0

I'm using AWS S3 with the help of the boto3 client in flask. I'm able to upload my files successfully to the s3 bucket. Deployed Appliation https://k8m00unpc6.execute-api.us-east-1.amazonaws.com/dev

I've been getting an error {"message":"Forbidden"}. The following code explains the implementation of the download in flask.

@app.route('/download/<filename>',methods=['POST','GET'])
def download(filename):
    return send_file('https://s3.amazonaws.com/zappa-jepozm5pw/'+filename+'_'+session['email']+'.doc',as_attachment=True)

Also I've given public access to all files.I'm also able to download the provided link when I enter it into a browser. When I implement it in flask, the efforts go in vain. What might be the error?

0 Answers0