<input type='file' name='upload1'/>
When this form is submitted,how can I get the "name" attribute (upload1) on node.js. I use restify,and upload image.
Just use node-formidable for file uploads.
The right way in node.js is would be to use a web app framework like express. It gives you more options as well as flexibility. In express you can do :
var express = require('express'); //Initialize express
var app = express();
app.listen(3000);
app.use(express.bodyParser()); //to parse the forms
app.post('/pagesubmit', function(request, response){ //to handle POST to the page
console.log(request.body.username); //tp access input text 'username'
console.log(request.files.name); //to access input file 'name'
});