本文实例为大家分享了Android九宫格图片展示的具体代码,供大家参考,具体内容如下
npm install formidable
var formidable = require('formidable'), http = require('http'), util = require('util'); 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'; form.parse(req, function(err, fields, files) { console.log(fields); console.log(files); }); } }).listen(3001);
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <form action="http://127.0.0.1:3001/index" method="post" enctype="multipart/form-data"> <p> 姓名:<input type="text" name="name"> </p> <p> 性别:<input type="radio" name="sex" value="男">男 <input type="radio" name="sex" value="女">女 </p> <p> 爱好:<input type="checkbox" name="hobby" value="吃饭">吃饭 <input type="checkbox" name="hobby" value="睡觉">睡觉 <input type="checkbox" name="hobby" value="游泳">游泳 </p> <p> 文件上传:<input type="file" name="images"> </p> <p> <input type="submit" value="提交"/> </p> </form> </body> </html>
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持找一找教程网。