Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

259
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!