I am using the code below to upload file-
Code:
app.post('/file_upload', function(req,res){ console.log('FIRST TEST: ' + JSON.stringify(req.files.theFile.name)); console.log('second TEST: ' +req.files.theFile.name); fs.readFile(req.files.theFile.path, function (err, data) { var newPath = "/tmp/"+req.files.theFile.name; var fileName = req.files.theFile fs.writeFile(newPath, data, function (err) { res.send("hi"); }); }); }); and i am getting Error:
TypeError: Cannot read property 'thumbnail' of undefined
Please guide me how to solve this.