vue-dropzone icon indicating copy to clipboard operation
vue-dropzone copied to clipboard

Getting 403 Forbidden error when trying to upload video directly to amason s3 with chunks

Open anidav opened this issue 5 years ago • 5 comments

I use vue-dropzone for uploading files directly to amazon s3. Everything is ok without chunking. Even uploaded large videos (400MB). But when I set chunking: true, I get 403 Forbidden error with this response.

<Code>AccessDenied</Code> <Message>Invalid according to Policy: Extra input fields: dzuuid</Message>

I have changed acl: public-read-write to acl: private, but it's not solved my problem.

anidav avatar Jun 21 '19 10:06 anidav

@anidav Could you provide all requests params which are sent to AWS.?

vrajroham avatar Jul 01 '19 09:07 vrajroham

This error occurs because we try to send the file in parts to S3. The parameters sent are from the file block. Captura de tela de 2020-01-10 17-26-16

marcostaborda avatar Jan 10 '20 20:01 marcostaborda

same issue image

masterit92 avatar Jun 07 '20 14:06 masterit92

This is happening because you need to specify these as conditions in your POST policy (generated on the server).

For example, in Python:

    response = s3.generate_presigned_post(
        Bucket=bucket,
        Key=key,
        Fields={
            "acl": "private",
            "Content-Type": contentType,
        },
        Conditions=[
            {"acl": "private"},
            {"Content-Type": contentType},
            ["starts-with", "$success_action_status", ""],
            ["starts-with", "$dzuuid", ""],
            ["starts-with", "$dzchunkindex", ""],
            ["starts-with", "$dztotalfilesize", ""],
            ["starts-with", "$dzchunksize", ""],
            ["starts-with", "$dztotalchunkcount", ""],
            ["starts-with", "$dzchunkbyteoffset", ""],
        ],
        ExpiresIn=one_hour,
    )

abrichr avatar Oct 16 '20 20:10 abrichr

Update: it appears that chunking is not supported, see: https://github.com/rowanwins/vue-dropzone/issues/544

abrichr avatar Oct 18 '20 22:10 abrichr