Commit 8156cd54 by Pragati Upadhyay

conTentType

parent 063cd85e
......@@ -13,7 +13,8 @@ const s3 = new AWS.S3({
region: CONFIG.S3_REGION,
})
module.exports.uploadToAwsS3 = async function (localPath, remotePath, options) {
module.exports.uploadToAwsS3 = async function (localPath, remotePath,contentType,options) {
console.log("🚀 ~ contentType:", contentType)
console.log("🚀 ~ options:", options)
const buffer = Fs.readFileSync(localPath);
......@@ -25,12 +26,12 @@ console.log("🚀 ~ options:", options)
Bucket: CONFIG.S3_BUCKET_NAME,
Key: remotePath,
};
if(options.contentType){
params.contentType = options.contentType
if(contentType.contentType){
params.contentType = contentType.contentType
}
s3.putObject(params, function (err, data) {
if (err) {
errorLog.error(err, `Exception handling error on uploadToAwsS3`);
console.log(err);
}
// successful response
});
......
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