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 年前檢視次數 331 次
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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南