PutObjectCommand always gives 400 error

no matter what i try to do my code always gives a 400 error trying to upload to the object storage using AWS V3 and V2 for javascript / node.

here is our code:

const s3 = new S3Client({
credentials: {
accessKeyId: MWSB_ENVIRONMENT_CONFIG.S3_ACCESSKEY,
secretAccessKey: MWSB_ENVIRONMENT_CONFIG.S3_SECRETACCESSKEY,
},
endpoint: 'https://' + bucket.hostname.replace(bucket.label + '.', ''),
region: bucket.region,
});

const command = new PutObjectCommand({
        Bucket: bucket.label,
        Key: 'sander.json,
        Body: JSON.stringify({sander:'test'}, null, 2),
        ContentType: mime.getType(uploadFilename),
        ACL: 'public-read',
      });
      await s3.send(command);

endpoint: https://nl-ams-1.linodeobjects.com
mime: application/json
bucket: gurdeep-3216-3216-ser
region: nl-ams

0 Replies

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct