5

I have a large number of files that I need to upload to Google Cloud Storage and add content type to them. All file names don't have an extension, but content type is the same for all of them.

I tried to use this command gsutil -m cp -r . gs://bucket_name/, but it uploads files with application/octet-stream content type.

Is there a way to override default content type that GCS sets?

1 Answer 1

12

Here, it gives an example of how to do this:

gsutil -h "Content-Type:text/html" \
       -h "Cache-Control:public, max-age=3600" cp -r images \
       gs://bucket/images

Not the answer you're looking for? Browse other questions tagged or ask your own question.