本文实例为大家分享了Android九宫格图片展示的具体代码,供大家参考,具体内容如下
npm install formidable
http.createServer(function(req,res) {
if (req.url == '/index' && req.method.toLowerCase() == 'post') {
// parse a file upload
var form = new formidable.IncomingForm();
form.uploadDir = './upload';
if (req.url == '/index' && req.method.toLowerCase() == 'post') {
// parse a file upload
var form = new formidable.IncomingForm();
form.uploadDir = './upload';
form.parse(req,function(err,fields,files) {
console.log(fields);
console.log(files);
});
}
}).listen(3001);
<Meta charset="UTF-8">
Document
<form action="http://127.0.0.1:3001/index" method="post" enctype="multipart/form-data">
姓名:
性别:dio" name="sex" value="男">男 dio" name="sex" value="女">女
爱好:Box" name="hobby" value="吃饭">吃饭 Box" name="hobby" value="睡觉">睡觉 Box" name="hobby" value="游泳">游泳