that function didnt exist. hope this fixes it
This commit is contained in:
parent
73491c9387
commit
1102ff0ef8
1 changed files with 1 additions and 1 deletions
2
index.js
2
index.js
|
@ -87,7 +87,7 @@ app.post('/api/upload', (req, res) => {
|
||||||
const file = req.files.file;
|
const file = req.files.file;
|
||||||
const filepath = `${config.storagePath}/${file.name}`;
|
const filepath = `${config.storagePath}/${file.name}`;
|
||||||
|
|
||||||
path.exists(filepath, (exists) => {
|
fs.exists(filepath, (exists) => {
|
||||||
if (!exists) {
|
if (!exists) {
|
||||||
file.mv(filepath, (err) => {
|
file.mv(filepath, (err) => {
|
||||||
if (err) return res.status(500).send(err);
|
if (err) return res.status(500).send(err);
|
||||||
|
|
Loading…
Reference in a new issue