Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Set contentEncoding when uploading a file #46

Closed
gsabater opened this issue Oct 30, 2018 · 1 comment
Closed

Set contentEncoding when uploading a file #46

gsabater opened this issue Oct 30, 2018 · 1 comment

Comments

@gsabater
Copy link

gsabater commented Oct 30, 2018

I can't find anything in this repo or Superbalist/flysystem-google-cloud-storage about this issue.
When I try to upload a file with the following code, i cannot set the content-encoding to gzip

\Storage::disk('gcs')
    ->getDriver()
    ->put('myfile.json', gzencode($json, 8), [
        'metadata' => [
            'contentType'     => 'text/plain',
            'ContentEncoding' => 'gzip'
        ]
    ]);

I have tried with ContentEncoding and Content-Encoding inside and outside the metadata array.
The content-type is set correctly but the encoding is not.

Thanks in advance

@gsabater
Copy link
Author

gsabater commented Oct 31, 2018

Ok, sorry for bothering again, it was just a typo on my end, ContentEncoding needs to be camelcase with the first letter in lowercase.

'metadata' => [
   'contentType'     => 'text/plain',
   'contentEncoding' => 'gzip'
 ]

Closing and leaving the issue in case anyone has the same problem.
Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant