Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
This package has been deprecated with the following message: Multer 1.x is affected by CVE-2022-24434. This is fixed in v1.4.4-lts.1 which drops support for versions of Node.js before 6. Please upgrade to at least Node.js 6 and version 1.4.4-lts.1 of Multer. If you need support for older versions of Node.js, we are open to accepting patches that would fix the CVE on the main 1.x release line, whilst maintaining compatibility with Node.js 0.10.
Generated on May 27, 2024 via pnpm

multer 0.1.7

Middleware for handling `multipart/form-data`.
Package summary
Share
7
issues
6
high severity
vulnerability
3
license
1
meta
2
1
low severity
license
1
3
licenses
13
MIT
1
ISC
1
BSD
Package created
1 Feb 2014
Version published
11 Jan 2015
Maintainers
3
Total deps
15
Direct deps
4
License
MIT

Issues

7

6 high severity issues

high
Recommendation: Upgrade to version 6.0.4 or later
via: qs@1.2.2
Recommendation: None
via: busboy@0.2.14
Recommendation: Upgrade to version 6.2.4 or later
via: qs@1.2.2
Recommendation: Validate that the package complies with your license policy
via: qs@1.2.2
via: mkdirp@0.3.5
via: multer@0.1.7
Collapse
Expand

1 low severity issue

low
Recommendation: Read and validate the license terms
via: qs@1.2.2
Collapse
Expand

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
13 Packages, Including:
busboy@0.2.14
core-util-is@1.0.3
dicer@0.2.5
isarray@0.0.1
media-typer@0.3.0
mime-db@1.12.0
mime-types@2.0.14
mkdirp@0.3.5
multer@0.1.7
readable-stream@1.1.14
streamsearch@0.1.2
string_decoder@0.10.31
type-is@1.5.7

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
inherits@2.0.4

BSD

Invalid
Not OSI Approved
1 Packages, Including:
qs@1.2.2
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

4
All Dependencies CSV
β“˜ This is a list of multer 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
busboy0.2.14208.41 kBMIT
prod
1
mkdirp0.3.54.06 kBMIT
prod
1
qs1.2.27.69 kBBSD
prod
3
1
type-is1.5.74.36 kBMIT
prod

Visualizations

Frequently Asked Questions

What does multer do?

Multer is a Node.js middleware for handling multipart/form-data, commonly used for uploading files. Written on top of busboy for optimum efficiency, Multer adds a body object and a file or files object to the request object. Please note that Multer will not process forms that are not multipart.

How do you use multer?

To use Multer, first, you need to install it using npm.

npm install --save multer

After installation, you can use Multer in your application. Below are some basic usage examples:

// Importing express and multer module
const express = require('express')
const multer  = require('multer')

// Specify the destination for uploading files
const upload = multer({ dest: 'uploads/' })

// Creating an instance of express
const app = express()

// Handling routes
app.post('/profile', upload.single('avatar'), function (req, res, next) {
  // req.file contains properties of 'avatar' file
  // req.body contains properties of text fields, if there were any
})

app.post('/photos/upload', upload.array('photos', 12), function (req, res, next) {
  // req.files will contain all 'photos' files
  // req.body will contain the text fields, if there were any
})

const cpUpload = upload.fields([{ name: 'avatar', maxCount: 1 }, { name: 'gallery', maxCount: 8 }])
app.post('/cool-profile', cpUpload, function (req, res, next) {
  // req.files is an object where the key is fieldname, and the value is an array of files
  // e.g., req.files['avatar'][0] -> File, req.files['gallery'] -> Array
  // req.body will contain the text fields, if there were any
})

In case you need to handle a text-only multipart form, you should use the .none() method:

app.post('/profile', upload.none(), function (req, res, next) {
  // req.body contains the text fields
})

Where are the multer docs?

The full multer documentation can be found on the official GitHub page of the Multer project. The documentation includes more detailed usage instructions, API reference, custom storage engine implementation, and error handling practices.