Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Created June 5, 2020 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uno-de-piera/c1441e96fc8c39413c658173971016a3 to your computer and use it in GitHub Desktop.
Save uno-de-piera/c1441e96fc8c39413c658173971016a3 to your computer and use it in GitHub Desktop.
var express = require('express')
var multer = require('multer')
var upload = multer({ dest: 'uploads/' })
var app = express()
app.post('/profile', upload.single('avatar'), function (req, res, next) {
// req.file is the `avatar` file
// req.body will hold the text fields, if there were any
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment