why isn't it working???? help
This commit is contained in:
parent
6001a52acc
commit
6905d3d0a8
1 changed files with 1 additions and 1 deletions
2
index.js
2
index.js
|
@ -139,7 +139,7 @@ app.post('/api/upload', [ cors(corsOptions) ], (req, res) => {
|
||||||
} else if(err.code === 'ENOENT') {
|
} else if(err.code === 'ENOENT') {
|
||||||
file.mv(filepath, (err) => {
|
file.mv(filepath, (err) => {
|
||||||
if (err) return res.status(500).render('uploadfailed', { message: 'something went wrong while uploading the file.' });
|
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 {
|
} else {
|
||||||
return res.status(500).render('uploadfailed', { message: 'something went wrong.' });;
|
return res.status(500).render('uploadfailed', { message: 'something went wrong.' });;
|
||||||
|
|
Loading…
Reference in a new issue