Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
const express = require('express');
const { filesUpload } = require('./middleware');
app = express();'/upload', filesUpload, function(req, res) {
// will contain all text fields
// will contain an array of file objects
fieldname: 'image', String - name of the field used in the form
originalname, String - original filename of the uploaded image
encoding, String - encoding of the image (e.g. "7bit")
mimetype, String - MIME type of the file (e.g. "image/jpeg")
buffer, Buffer - buffer containing binary data
size, Number - size of buffer in bytes
exports = app;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment