Im tearing my hair out trying to get an S3 Direct Client Side PUT operation to work.

We have a version of the backend code working on Python without any issues(so we know the frontend works just fine) and we are trying to port the backend to Node.JS.

I have an endpoint setup that that returns a signed PUT URL, here is the code:

var objectKey = req.query.s3_object_name; var objectType = req.query.s3_object_type; var params = { Bucket: s3Bucket, Key: objectKey, // ContentType: objectType, //(I have tried with and without this) Expires: 60 }; s3.getSignedUrl('putObject', params, function(err, signedUrl){ if(err){ res.send(400); }else{ res.end(JSON.stringify({ signed_request: signedUrl, url: "http://"+s3Bucket+".s3.amazonaws.com/"+objectKey })); } });

Unfortunately Amazon always returns the following error:

SignatureDoesNotMatch - The request signature we calculated does not match the signature you provided. Check your key and signing method.

Has anybody successfully got the JavaScript aws-sdk to perform this task successfully? Any pointers? I have double and triple checked my AWS Key and Secret.

Regards:

John Chipps-Harding