How to use the multer.single function in multer

To help you get started, we’ve selected a few multer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github newmips / newmips / structure / pieces / component / synchronization / api / e_synchronization.js View on Github external
const express = require('express');
const router = express.Router();
const fs = require("fs-extra");
const models = require('../models/');
const entity_helper = require('../utils/entity_helper');
const upload = require('multer')().single('file');
const moment = require('moment');
const globalConf = require('../config/global');

// *********** Cloud function *************
// This method receives and processes situation and send the dump of Cloud DB to the tablet
// *****************************************
router.post('/situation', function(req, res) {
	// Operation can take some time, remove timeout of response
	res.setTimeout(0);

	function executeJournal(journal) {

		// Start MYSQL transaction.
		// If anything goes wrong during the execution of the journal, all modifications will be rolled back.
		// It's important not to break the `promise chain` by returning each promise to its parent to keep transaction open
		return models.sequelize.transaction(function(transac) {

multer

Middleware for handling `multipart/form-data`.

MIT
Latest version published 2 years ago

Package Health Score

79 / 100
Full package analysis