弑天下
策略文档可让您更好地控制上传到 Cloud Storage 的对象,通过此功能,您可以控制每次上传必须满足的一系列条件。由于您需要控制需要上传的对象的大小,我建议您看一下这里指出的这个示例:{"expiration": "2020-06-16T11:11:11Z", "conditions": [
["starts-with", "$key", ""],
{"bucket": "travel-maps"},
{"success_action_redirect": "http://www.example.com/success_notification.html"},
["eq", "$Content-Type", "image/jpeg"],
["content-length-range", 0, 1000000],
{"x-goog-algorithm": "GOOG4-RSA-SHA256"},
{"x-goog-credential": "example_account@example_project.iam.gserviceaccount.com/20191102/auto/storage/goog4_request"},
{"x-goog-date": "20191102T043530Z"}
]}如您所见,字段“content-length-range”, 0, 1000000] 不允许大于 1Mb 的文档。