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