Socket
Socket
Sign inDemoInstall

multer

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multer - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

8

index.js

@@ -81,3 +81,5 @@ var os = require('os');

ext = '.' + filename.split('.').slice(-1)[0];
if (filename.indexOf('.') > 0) { ext = '.' + filename.split('.').slice(-1)[0]; }
else { ext = ''; }
newFilename = rename(fieldname, filename.replace(ext, '')) + ext;

@@ -135,2 +137,6 @@ newFilePath = path.join(dest, newFilename);

fileStream.on('limit', function () {
if (options.onFileSizeLimit) { options.onFileSizeLimit(file); }
});
ws.on('error', function(error) {

@@ -137,0 +143,0 @@ // trigger "file error" event

2

package.json
{
"name": "multer",
"version": "0.1.1",
"version": "0.1.2",
"description": "Connect middleware for handling multipart/form-data",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -197,2 +197,13 @@ # Multer [![Build Status](https://travis-ci.org/expressjs/multer.svg?branch=master)](https://travis-ci.org/expressjs/multer) [![NPM version](https://badge.fury.io/js/multer.svg)](https://badge.fury.io/js/multer)

### onFileSizeLimit()
Event handler triggered when a file size exceeds the specification in the `limit` object. No more files will be parsed after the limit is reached.
```js
onFileSizeLimit: function (file) {
console.log('Failed: ', file.originalname)
fs.unlink('./' + file.path) // delete the partially written file
}
```
### onFilesLimit()

@@ -199,0 +210,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc