node.js 上传东西到服务器 express

<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
<form method="post" enctype="multipart/form-data" action="/file-upload">
    <input type="text" name="username">
    <input type="password" name="password">
    <input type="file" name="thumbnail">
    <input type="submit">
</form>
</body>
</html>



app.post('/file-upload', function(req, res, next) {
    console.log(req.body);
    console.log(req.files);
});


你可能感兴趣的:(express,node.js,node.js)