Comparing version 0.1.1 to 0.1.2
@@ -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 |
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
15427
148
257
0