Skip to content
Advertisement

AWS Upload with multipart/form-data Invalid

I am sending a file to the presignedPOST url to upload to AWS S3 and in other resources I’ve found, to send a file with form-data is to switch to multipart/form-data to send a file.

This is the form data I’ve created is this:

JavaScript

this is the field in the form in the PARAMs for the request:

JavaScript

Is something going wrong here?

UPDATE: AWS does respond, but not with an error that is relevant to the file. I’m not sure if this means that the file is still valid, but just looking at the value for the image file, I’m not sure how.

JavaScript

I’m using the aws-sdk and creating the presignedPOST url like so:

JavaScript

Do I still need to add a signature to this?

Advertisement

Answer

I removed the unneeded AWSAccessKeyId in the fields object. In an example somewhere I saw that it was added so I added it initially.

Removing it makes it works like a charm and I think it messes up AWS’s specific required order of the fields.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement