Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

260
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda