0
votes

Google cloud storage - How to specify allowed file formats as part of signed URL validation

I want to allow only zip files to be uploaded to GCS by the user .How do I restrict the user ? User will have only signed URL ,which directly interacts with GCP .

Is there any attribute which can be set as part of generating signed URL ?

Thanks in advance

1
You cannot specify the file format. You can only specify the Content-Type. I could rename a PNG to ZIP and the upload would complete.John Hanley

1 Answers

3
votes

You can specify -c <content_type> as zip while creating the signed URL.

Check this