Created
February 12, 2022 14:57
-
-
Save SiddiqueAhmad/1693e0a0fc4e0ef1c261fb7e0ba0116f to your computer and use it in GitHub Desktop.
upload file and form field
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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