enter code here
I am using "aws-sdk": "^2.1551.0" npm for file uploads, I've noticed that uploading a large image file (10 MB) to a Wasabi bucket takes more than 15 seconds. How can I make the upload process faster?
I aim to achieve uploads of large files within 3 seconds. Furthermore, I seek clarification on the difference between aws-sdk and aws-sdk/client-s3. Will using aws-sdk/client-s3 result in faster uploads? If not, could you provide a suitable solution?
const AWS = require('aws-sdk');
const settings = await Settings.findOne({})
const s3 = new AWS.S3({
accessKeyId: settings.accessKeyId,
secretAccessKey: settings.secretAccessKey,
region: settings.region,
endpoint: settings.endpoint,
});
const params = {
Bucket: settings.bucketName,
Key: `${setting.bucketName}/photos/${DIR}/${newFileName}`,
Body: file.buffer,
ContentType: file.mimetype,
};
s3.upload(params, (err, data) => {
if (err) {
console.error('Error uploading photo:', err);
return next(new ErrorHandler(err, 200));
} else {
console.log('Photo uploaded successfully.', data);
}
});