Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

getting error 400

hello, everything is working fine until i add extra condition in conditions array i.e code is

["starts-with", "$key", ""],
['eq', '$Content-Type', 'image/*'], 
for checking only image can be uploaded but it give me error and i.e. error is 
InvalidPolicyDocument
Invalid argument.
The content of the form does not meet the conditions specified in the policy document. Missing key: content-type

can you help me out to write condition to only upload image.

3 1 333
1 REPLY 1

Hi @tony-stark-jr,

Welcome to Google Cloud Community!

Please check the following documentation if the query string parameters are properly configured since the error mentioned that it is missing Content-Type:

Please be advised that if you don't specify a Content-Type, Cloud Storage defaults to application/octet-stream when it serves the content.

With regards to error 400 and you're performing resumable uploads, Content-Range header is invalid. Your current resumable upload is no longer active and you must start a new resumable upload. Please refer to this link on troubleshooting Cloud Storage.

Hope this helps.