Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

474
Vistas
Image upload to AWS s3 :Allow only jpg and png images

I am trying to upload only certain type of images into aws s3 bucket. For that i've added the following rule to my bucket policy

"Resource": [
                "arn:aws:s3:::<bucket name>/*.jpg",
                "arn:aws:s3:::<bucket name>/*.png",
            ]

This works fine ,however when i change extension of text file to png (eg: change sample.txt to sample.png) and try to upload its uploaded.

How can i prevent this??.

One solution i've founded is add a php image validation in my code and upload to AWS s3 ,but here i am using s3 direct browser upload in this method there is no need of normal way of php file upload also reduces the server overload. So i think adding php image validation on s3 direct browser upload is bad practise.

about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda