0

I'm trying to sync my json file to s3 with --content-type application/json , but when I inspect the response header, it is content-type: binary/octet-stream.

sh "aws s3 sync ./public ${mybucket} --exclude '*' --include '*.json' --content-type 'application/json' --cache-control public,max-age=31536000,immutable"

Appreciated any help.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
R.R
  • 847
  • 1
  • 9
  • 20
  • While the command looks correct, could you try using `aws s3api put-object` command as mentioned in the following link and update: https://stackoverflow.com/a/29656722/10846194 – st_rt_dl_8 Apr 21 '20 at 03:01
  • Your command worked perfectly well for me! Perhaps the files had already been copied, so they did not re-sync. To forcibly trigger the copy, use `aws s3 cp --recursive ...` instead of `aws s3 sync ...`. – John Rotenstein Apr 21 '20 at 04:53

0 Answers0