Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
File upload AmazonS3支持多种内容类型_File Upload_Amazon S3 - Fatal编程技术网

File upload AmazonS3支持多种内容类型

File upload AmazonS3支持多种内容类型,file-upload,amazon-s3,File Upload,Amazon S3,在AWS S3上传中,有人知道我如何限制多种内容类型吗? 例如: 图像/jpeg 文本/纯文本 视频/x-msvideo 我知道我可以用 ["starts-with", "$Content-Type", "image/jpeg"] 或 但是,对于像视频这样的多种类型,我该怎么做呢 或者我有没有办法阻止上传应用程序/*?我可以阻止特定的文件类型吗 谢谢文档模棱两可,但策略语言显然是面向“允许”而不是“拒绝”。您是否尝试过策略中的[“以“,”$Content Type”,“image/*”],[“

在AWS S3上传中,有人知道我如何限制多种内容类型吗? 例如:

图像/jpeg 文本/纯文本 视频/x-msvideo

我知道我可以用

["starts-with", "$Content-Type", "image/jpeg"]

但是,对于像视频这样的多种类型,我该怎么做呢

或者我有没有办法阻止上传应用程序/*?我可以阻止特定的文件类型吗


谢谢

文档模棱两可,但策略语言显然是面向“允许”而不是“拒绝”。您是否尝试过策略中的
[“以“,”$Content Type”,“image/*”],[“以“,”$Content Type”,“video/*”],[“以“,”$Content Type”,“text/*”]
?如果有办法的话,似乎就是这样。实际上,
*
可能完全错了。由于条件是“以开头”,因此该值可能只是字符串前缀,例如
[“以开头”、“$Content Type”、“image/”]
["starts-with", "$Content-Type", "image/*"]