Created
March 29, 2019 18:04
-
-
Save msukmanowsky/024742f44aacd425f14d7254595684c8 to your computer and use it in GitHub Desktop.
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
const express = require('express'); | |
const { filesUpload } = require('./middleware'); | |
app = express(); | |
app.post('/upload', filesUpload, function(req, res) { | |
// will contain all text fields | |
req.body | |
// 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 | |
} | |
*/ | |
req.files | |
}) | |
exports = app; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment