Fixed uploads not properly saving to save dir

pull/93/head
tycrek 3 years ago
parent 3296e119af
commit 553e07119d
No known key found for this signature in database
GPG Key ID: 25D74F3943625263

@ -113,12 +113,16 @@ function processUploaded(req, res, next) { // skipcq: JS-0045
.catch(reject)
))
.then(() => log.debug('File saved', req.file.originalname, s3enabled ? 'in S3' : 'on disk'))
.then(() => !s3enabled && (req.file.path = getLocalFilename(req))) // skipcq: JS-0090
.then(() => next())
.catch(next)
.finally(() => fs.remove(req.file.path))
// Delete the file
.then(() => fs.remove(req.file.path))
.then(() => log.debug('Temp file', 'deleted'))
.catch((err) => log.err(err));
// Fix the file path
.then(() => !s3enabled && (req.file.path = getLocalFilename(req))) // skipcq: JS-0090
.then(() => next())
.catch(next);
}
function deleteS3(file) {

Loading…
Cancel
Save