2
votes

Got a problem, using GCS signed url feature (https://cloud.google.com/storage/docs/access-control/signed-urls) and want to force response content disposition.

I've used it once before in the past, but now I cannot seem to get it work and cannot find any documentation about Google deprecating this feature.

My current example url: https://storage.googleapis.com/examplebucket/examplefile.pdf?GoogleAccessId=account&Expires=expire&Signature=xx&response-content-disposition=inline

Signing is working and I can reach the file, just cannot force disposition.

If I upload file as Content-Disposition=attachment, then it wont make it inline and vice versa.

Any ideas?

1
I could find documentation stating that this query parameter is not signed, however, I found no official documentation for this header to be supported. Would be great if anyone can direct to an official documentation for this.galusben

1 Answers

4
votes

For signed URLs, the contentDisposition metadata property, if specified, overrides the response-content-disposition query parameter. This is because the response-content-disposition query parameter is not part of the signature, which means that end users could change it.

If you want to specify response-content-disposition in the signed URL, clear the contentDisposition metadata property, and the value in the query parameter will be used.