You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<inputtype="text"class="form-control"placeholder="Number of speakers"name="nspeakers">
88
+
<inputtype="submit"value="Get me the stats!"class="btn btn-default">
89
+
</div>
90
+
</form>
91
+
```
92
+
93
+
Then in your javascript file you would add these lines to access both the file and the body. It is important that you use the `name` field value from the form in your upload function. This tells multer which field on the request it should look for the files in. If these fields aren't the same in the HTML form and on your server, your upload will fail:
The memory storage engine stores the files in memory as `Buffer` objects. It
213
247
doesn't have any options.
214
248
215
249
```javascript
216
-
var storage =multer.memoryStorage()
217
-
var upload =multer({ storage: storage })
250
+
conststorage=multer.memoryStorage()
251
+
constupload=multer({ storage: storage })
218
252
```
219
253
220
254
When using memory storage, the file info will contain a field called
@@ -233,7 +267,7 @@ The following integer values are available:
233
267
Key | Description | Default
234
268
--- | --- | ---
235
269
`fieldNameSize` | Max field name size | 100 bytes
236
-
`fieldSize` | Max field value size | 1MB
270
+
`fieldSize` | Max field value size (in bytes) | 1MB
237
271
`fields` | Max number of non-file fields | Infinity
238
272
`fileSize` | For multipart forms, the max file size (in bytes) | Infinity
239
273
`files` | For multipart forms, the max number of file fields | Infinity
@@ -274,8 +308,8 @@ If you want to catch errors specifically from Multer, you can call the
274
308
middleware function by yourself. Also, if you want to catch only [the Multer errors](https://github.com/expressjs/multer/blob/master/lib/multer-error.js), you can use the `MulterError` class that is attached to the `multer` object itself (e.g. `err instanceof multer.MulterError`).
0 commit comments