Comparing version 0.1.2 to 0.1.3
@@ -12,2 +12,3 @@ var os = require('os'); | ||
options = options || {}; | ||
options.includeEmptyFields = options.includeEmptyFields || false; | ||
@@ -56,4 +57,5 @@ // specify the destination directory, else, the uploads will be moved to the temporary dir of the system | ||
// don't attach to the body object, if there is no value | ||
if (!val) return; | ||
// if includeEmptyFields is false and there is no value then don't | ||
// attach the fields to req.body | ||
if (!options.includeEmptyFields && !val) return; | ||
@@ -60,0 +62,0 @@ if (req.body.hasOwnProperty(fieldname) && val) { |
{ | ||
"name": "multer", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Connect middleware for handling multipart/form-data", | ||
@@ -28,13 +28,13 @@ "main": "index.js", | ||
"dependencies": { | ||
"busboy": "^0.2.6", | ||
"busboy": "^0.2.7", | ||
"mkdirp": "~0.3.5", | ||
"qs": "^0.6.6", | ||
"busboy": "^0.2.7" | ||
"qs": "^0.6.6" | ||
}, | ||
"devDependencies": { | ||
"connect": "*", | ||
"chai": "^1.9.1", | ||
"co": "^3.0.6", | ||
"express": "*", | ||
"mocha": "*", | ||
"should": "*", | ||
"supertest": "*", | ||
"express": "*" | ||
"rimraf": "^2.2.8", | ||
"supertest": "^0.13.0" | ||
}, | ||
@@ -41,0 +41,0 @@ "author": { |
@@ -56,2 +56,3 @@ # 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) | ||
* `limits` | ||
* `includeEmptyFields` | ||
* `rename(fieldname, filename)` | ||
@@ -64,2 +65,3 @@ * `onFileUploadStart(file)` | ||
* `onError()` | ||
* `onFileSizeLimit(file)` | ||
* `onFilesLimit()` | ||
@@ -112,2 +114,10 @@ * `onFieldsLimit()` | ||
### includeEmptyFields | ||
A Boolean value to specify whether empty submitted values should be processed and applied to `req.body`; defaults to `false`; | ||
```js | ||
includeEmptyFields: true | ||
``` | ||
### rename(fieldname, filename) | ||
@@ -114,0 +124,0 @@ |
Sorry, the diff of this file is not supported yet
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
15811
150
267
6