diff --git a/utils.js b/utils.js index d2440d8..d0bb7cd 100755 --- a/utils.js +++ b/utils.js @@ -43,7 +43,7 @@ module.exports = { arrayEquals: (arr1, arr2) => arr1.length === arr2.length && arr1.slice().sort().every((value, index) => value === arr2.slice().sort()[index]), downloadTempS3: (file) => new Promise((resolve, reject) => fetch(getS3url(file.randomId, file.mimetype)) - .then((f2) => f2.body.pipe(fs.createWriteStream(Path.join(__dirname, 'uploads/', file.originalname)).on('close', () => resolve()))) + .then((f2) => f2.body.pipe(fs.createWriteStream(Path.join(__dirname, 'uploads/', sanitize(file.originalname))).on('close', () => resolve()))) .catch(reject)), getS3url, getSafeExt,