如何使Plupload直接上传到亚马逊的S3?亚马逊、Plupload

2023-09-11 23:37:01 作者:姑凉似花我是渣.

如何配置 Plupload 正确,这样它会直接上传文件的亚马逊S3 ?

How do I configure Plupload properly so that it will upload files directly to Amazon S3?

推荐答案

在除了性条件的水桶,钥匙,和ACL,策略文件必须包含名称,文件名和success_action_status规则。例如:

In addition to condictions for bucket, key, and acl, the policy document must contain rules for name, Filename, and success_action_status. For instance:

    ["starts-with", "$name", ""],
    ["starts-with", "$Filename", ""],
    ["starts-with", "$success_action_status", ""],

文件名是闪存后端发送一个领域,但HTML5的后端没有。

Filename is a field that the Flash backend sends, but the HTML5 backend does not.

多部分设置必须是真实的,但是这是默认的,这些天。

The multipart setting must be True, but that is the default these days.

multipart_params 设置必须是一个具有以下字段词典:

The multipart_params setting must be a dictionary with the following fields:

AWSAccessKeyId ACL =私人 策略 签名 success_action_status ='201' key AWSAccessKeyId acl = 'private' policy signature success_action_status = '201'

success_action_status 设置为201使S3与HTTP状态code 201这是必要的,以使闪光灯的后端工作返回的XML文档。 (闪光灯上传摊位当响应为空,code是200或204这会导致I / O错误,如果响应重定向。)

Setting success_action_status to 201 causes S3 to return an XML document with HTTP status code 201. This is necessary to make the flash backend work. (The flash upload stalls when the response is empty and the code is 200 or 204. It results in an I/O error if the response is a redirect.)

S3不理解块,所以删除 CHUNK_SIZE 配置选项。

S3 does not understand chunks, so remove the chunk_size config option.

 
精彩推荐