why isn't it working???? help

This commit is contained in:
hippoz 2020-10-18 19:44:11 +03:00
parent 6001a52acc
commit 6905d3d0a8

View file

@ -139,7 +139,7 @@ app.post('/api/upload', [ cors(corsOptions) ], (req, res) => {
} else if(err.code === 'ENOENT') {
file.mv(filepath, (err) => {
if (err) return res.status(500).render('uploadfailed', { message: 'something went wrong while uploading the file.' });
res.render('uploaded', { file: { name: chosenFileName }, baseurl: config.url });
res.render('uploaded', { baseurl: config.url, file: { name: chosenFileName } });
});
} else {
return res.status(500).render('uploadfailed', { message: 'something went wrong.' });;