google cloud storage - Enforcing object max size and content/mime type within signed upload URLs -
in order generate expiring upload urls using cloud storage signed urls. now, need restrict maximum file size (i.e. 32mb) , accepted content-types - image files valid. there built-in mechanism within gcs allow enforce upload policies?
you can restrict content-type, option part of string when creating signed url. google cloud storage return when http requests made objects.
it's possible specify policy document when preparing signed post request, including requirements expected content-type
, content-length-range
minimum , maximum size.
for cases values supported policy document not enough, can use object change notification implement custom validation on uploads, including limiting size. if upload didn't meet rules, delete immediately.
Comments
Post a Comment