How upload file authenticated in s3 bucket with python

0

i usualy used my aplication for upload files in s3 bucket, but accessing aws console, when click in open, the file dont open but do downloaded. why this happened? i am used this code below to upload.

  s3_client = boto3.client('s3', aws_access_key_id=AWS_ACCESS_KEY_ID, aws_secret_access_key=AWS_SECRET_ACCESS_KEY)
            s3_client.upload_file(file, S3_BUCKET, item_drop_down + '/{}'.format(arquivo.filename))
JrdoBem
已提问 2 年前330 查看次数
2 回答
0

Seems like your bucket is public but not the object's in bucket, that's why when you click on the uploaded file/object it isn't opening but you are able to download the same.

已回答 2 年前
  • but there it is, if I add the object through the aws console, I can open it. Is it something related to politics?

0

I thing found the problem, but i dont know to resolved! the metadate value need application/pdf, but how to change this value ?Enter image description here

JrdoBem
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则