如何限制Google Cloud Storage存储桶的文件类型? [英] How can I restrict the file types of my Google Cloud Storage bucket?

查看:67
本文介绍了如何限制Google Cloud Storage存储桶的文件类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何限制Google Cloud Storage存储桶的文件类型?

How can I restrict the file types of my Google Cloud Storage bucket ?

例如,我如何选择一个存储桶并精确确定其只能包含jpeg,jpg或png,并且应该拒绝任何其他类型的文件?

For example, how do I select a bucket and precise it can only contain jpeg, jpg or png and should refuse any other kind of file ?

推荐答案

请参见政策文件条件.但是,这对其他上传机制没有帮助,因此您必须采用其他方式(也许是 Cloud Function ,它会在上传时检查内容类型并删除违规者.

See policy document conditions for form POSTs. This won't help with other upload mechanisms, however, so you'll have to do that some other way (maybe a Cloud Function that does a content type check on upload and deletes violators).

这篇关于如何限制Google Cloud Storage存储桶的文件类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆