Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

accepting form data node js


const express = require('express')
const fileUpload = require('express-fileupload');

const app = express()
app.use(fileUpload());

app.post('/file-upload', function(req, res, next) {
  console.log(req.body.msg);
  console.log(req.files);
  res.send('ok');
  next();
});

app.listen(3000, function () {
  console.log('Example app listening on port 3000!')
})

Source by w3programmers.org #
 
PREVIOUS NEXT
Tagged: #accepting #form #data #node #js
ADD COMMENT
Topic
Name
3+2 =