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
gefragt vor 2 Jahren331 Aufrufe
2 Antworten
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.

beantwortet vor 2 Jahren
  • 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
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen