-
Notifications
You must be signed in to change notification settings - Fork 146
Accept metadata in options #7
Comments
How can i Put file with custom Control-Cache metadata? |
You can pass it in the 'metadata' key when 'putting' the object. |
i tried several ways, but couldn't set the cache value. i tried
any clue? |
Same here, I cannot pass metadata, I need to pass cache control and expires headers. Previously when using s3,w here I wanted all uploads to have set meta data, within the filesystems.php config I had the following, that worked fine:
I'm unsure if https://github.com/Superbalist/laravel-google-cloud-storage/blob/master/src/GoogleCloudStorageServiceProvider.php#L29 is affecting this. |
@Rafeethu |
Just in case anyone comes across this in the future (I'm using Digital Ocean in my case here), it turns out that to pass in custom metadata, you have to use the keyword "Metadata" with an uppercase "M", otherwise it's ignored. I don't know if that's a Laravel limitation, or an API requirement, but if you just use "metadata" with a lowercase "m", the metadata will be ignored. Therefore the options array would look like this: The uploaded file in my case then has a new custom metadata element that looks like this: I assume the "amz" here is because it's s3 compatible, but no clue lol Hope this helps someone. |
Hello there,
The
getOptionsFromConfig
method should accept the metadata key as a possible value.I require this for the following properties:
The official google cloud documentation shows that the StorageObject allows the metadata property.
https://googlecloudplatform.github.io/google-cloud-php/#/docs/v0.20.1/storage/storageobject?method=update
And the JSON API docs shows what properties the StorageObject can contain.
https://cloud.google.com/storage/docs/json_api/v1/objects#resource
The text was updated successfully, but these errors were encountered: