Skip to content

Instantly share code, notes, and snippets.

@patcito
Created July 25, 2012 21:16
Show Gist options
  • Save patcito/3178715 to your computer and use it in GitHub Desktop.
Save patcito/3178715 to your computer and use it in GitHub Desktop.
// html code:
<form method='post' action='/files' enctype="multipart/form-data">
<input type='file' name='files' multiple>
<input type='submit' name='upload'>
</form>
// node code:
app.post('/files', function(req, res, next){
if(req.files){
user_file.save(function(err){
console.log(user_file)
});
} else {
next();
}
req.on('complete', function(err, fields, files){
console.log('done')
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment