JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 41200
  • Score
    100M100P100Q17925F
  • License MIT

multipart parsing middleware for connect using multiparty

Package Exports

  • connect-multiparty

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (connect-multiparty) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

connect-multiparty

connect middleware for multiparty.

I actually recommend against using this module. It's cleaner to use the multiparty API directly.

This middleware will create temp files on your server and never clean them up. Thus you should not add this middleware to all routes; only to the ones in which you want to accept uploads. And in these endpoints, be sure to delete all temp files, even the ones that you don't use.

Usage

var multipart = require('connect-multiparty');
var multipartMiddleware = multipart();
app.post('/upload', multipartMiddleware, function(req, resp) {
  console.log(req.body, req.files);
  // don't forget to delete all req.files when done
});

If you pass options to multipart(), they are passed directly into multiparty.