From 32a3375f5ba699e0fba0f1544b699be835c9b272 Mon Sep 17 00:00:00 2001 From: tycrek Date: Wed, 16 Jun 2021 17:42:42 -0600 Subject: [PATCH] properly set mimetype for S3 --- s3.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/s3.js b/s3.js index 4d9277f..559a1db 100644 --- a/s3.js +++ b/s3.js @@ -13,7 +13,8 @@ const upload = multer({ s3: s3, bucket: s3bucket, acl: 'public-read', - key: (_req, file, cb) => cb(null, file.originalname) + key: (_req, file, cb) => cb(null, file.originalname), + contentType: (_req, file, cb) => cb(null, file.mimetype) }) }).single('file');