使用ejs
index.html
<form method="post" enctype="multipart/form-data" action="/file-upload"> <input type='file' name='file' id="file"/> <input type='submit'> </form>app.js
app.use(express.bodyParser());
app.post('/file-upload’,function(req, res){ console.log(req.files); res.send(‘return send’); });
但是打印的 req.files 为undefined.
求解答.谢谢各位.