Commit da77571e by Pragati Upadhyay

conTentType

parent 9ca3034f
...@@ -14,7 +14,6 @@ const s3 = new AWS.S3({ ...@@ -14,7 +14,6 @@ const s3 = new AWS.S3({
}) })
module.exports.uploadToAwsS3 = async function (localPath, remotePath, options) { module.exports.uploadToAwsS3 = async function (localPath, remotePath, options) {
console.log("🚀 ~ options:", options)
const buffer = Fs.readFileSync(localPath); const buffer = Fs.readFileSync(localPath);
...@@ -24,8 +23,10 @@ console.log("🚀 ~ options:", options) ...@@ -24,8 +23,10 @@ console.log("🚀 ~ options:", options)
Body: buffer, Body: buffer,
Bucket: CONFIG.S3_BUCKET_NAME, Bucket: CONFIG.S3_BUCKET_NAME,
Key: remotePath, Key: remotePath,
ContentType: options.contentType
}; };
if(options.contentType){
params.contentType = options.contentType
}
s3.putObject(params, function (err, data) { s3.putObject(params, function (err, data) {
if (err) { if (err) {
errorLog.error(err, `Exception handling error on uploadToAwsS3`); errorLog.error(err, `Exception handling error on uploadToAwsS3`);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment