At the moment, we can upload the file to the server with any extension.To control which files should be uploaded and which should be skipped in multer module provides Answer To determine if a file is an valid we can read the first bytes of the stream and compare it with magic numbers https://en.wikipedia.org/wiki/Magic_number_(programming).
Note: Multer will not append any file extension for you, your function should return a filename complete with an file extension. I want to contribute to those who may arrive later. If you are part of the family and would like full access, you can request an account. You will find a wealth of information about the people that make up and are connected with the Multer family. You are welcome to access all the information on this site, but information for living persons will remain hidden.Below is a full functional server script to handle multiple uploaded pictures with random saved pictures names and file extension.var express = require("express"); var multer = require("multer"); var app = express(); var path = require("path"); var uuid = require("uuid"); // Allow cross origin resource sharing (CORS) within our application app.use(function(req, res, next) ); var storage = Storage() var upload = multer() // "files" should be the same name as what's coming from the field name on the client side.