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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ