这是我的表单如何与节点 js 连接。提交此表单时
<form id="fileupload" action="/file-upload" method="POST" enctype="multipart/form-data">
<input id="fileToBeUploaded" type="file" name="thumbnail">
<input type="submit" value="upload">
</form>
服务器端
var http = require("http");
var url = require("url");
http.createServer(function(req, res) {
switch (url.parse(req.url).pathname)
{
case '/': console.log('server side methodcalled');
break;
case '/file-upload': console.log('server side method called');
break;
default:
console.log('server side method called');
break;
}
});