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

261
Vistas
How to avoid AWS S3 changing file content-type from text/html?

I'm using S3 to host a static website for a portfolio. For each webpage the .htmlextension is removed. The problem with this is that AWS automatically categorizes the file as binary/octet-stream. The problem here is that when you access the extension such as myportfolio.com/contact instead of rendering the page, the file just downloads into the downloads folder.

By going to

[Object] → properties → metadata → content-type

I am able to change the type to text/html which causes the file to render instead of downloading.

Now after having made a change to all the files and re-uploading them using AWS Cli:

AWS s3 sync . s3://[bucketname]

the files went back to the old content-type. How do I permanently set the content type on these files?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Have you tried setting the --content-type flag? For example,

AWS s3 sync . s3://[bucketname] --content-type "text/html"

More info on this can be found here in the sync documentation

UPDATE: try this command for deployment,

aws s3 sync --acl public-read --sse --delete . s3://[bucketname]

--acl sets the files to be public read, --sse stores files encrypted, --delete removes files that are not in your local file.

about 4 years ago · Santiago Trujillo Denunciar
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