Skip to content

Instantly share code, notes, and snippets.

@SiddiqueAhmad
Created Feb 12, 2022
Embed
What would you like to do?
upload file and form field
var express = require('express')
var app = express()
const multer = require('multer')
const upload = multer({ dest: 'uploads/' })
// POST /login gets urlencoded bodies
app.post('/sample', upload.single('uploaded_file'), function (req, res) {
console.log(req.file)
res.send( req.body)
})
app.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment