Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 8, 2024 via pnpm

multer 1.4.5-lts.1

Middleware for handling `multipart/form-data`.
Package summary
Share
0
issues
2
licenses
22
MIT
1
ISC
Package created
1 Feb 2014
Version published
30 May 2022
Maintainers
3
Total deps
23
Direct deps
7
License
MIT

Issues

0
This package has no issues

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
22 Packages, Including:
append-field@1.0.0
buffer-from@1.1.2
busboy@1.6.0
concat-stream@1.6.2
core-util-is@1.0.3
isarray@1.0.0
media-typer@0.3.0
mime-db@1.52.0
mime-types@2.1.35
minimist@1.2.8
mkdirp@0.5.6
multer@1.4.5-lts.1
object-assign@4.1.1
process-nextick-args@2.0.1
readable-stream@2.3.8
safe-buffer@5.1.2
streamsearch@1.1.0
string_decoder@1.1.1
type-is@1.6.18
typedarray@0.0.6
util-deprecate@1.0.2
xtend@4.0.2

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
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

7
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
append-field1.0.02.7 kBMIT
prod
busboy1.6.019.67 kBMIT
prod
concat-stream1.6.23.72 kBMIT
prod
mkdirp0.5.62.95 kBMIT
prod
object-assign4.1.12.61 kBMIT
prod
type-is1.6.185.73 kBMIT
prod
xtend4.0.22.47 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.