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
preguntada hace 2 años330 visualizaciones
2 Respuestas
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.

respondido hace 2 años
  • 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
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas