@@ -64,7 +64,8 @@ _**Note: v2 is coming soon!**_
64
64
## Highlights
65
65
66
66
- [ Fast (~ 900-2500 mb/sec)] ( #benchmarks ) & streaming multipart parser
67
- - Automatically writing file uploads to disk (soon optionally)
67
+ - Automatically writing file uploads to disk (optional, see
68
+ [ ` options.fileWriteStreamHandler ` ] ( #options ) )
68
69
- [ Plugins API] ( #useplugin-plugin ) - allowing custom parsers and plugins
69
70
- Low memory footprint
70
71
- Graceful error handling
@@ -310,8 +311,8 @@ const form = new Formidable(options);
310
311
311
312
### Options
312
313
313
- See it's defaults in [ src/Formidable.js DEFAULT_OPTIONS] ( ./src/Formidable.js ) (the
314
- ` DEFAULT_OPTIONS ` constant).
314
+ See it's defaults in [ src/Formidable.js DEFAULT_OPTIONS] ( ./src/Formidable.js )
315
+ (the ` DEFAULT_OPTIONS ` constant).
315
316
316
317
- ` options.encoding ` ** {string}** - default ` 'utf-8' ` ; sets encoding for
317
318
incoming form fields,
@@ -334,6 +335,16 @@ See it's defaults in [src/Formidable.js DEFAULT_OPTIONS](./src/Formidable.js) (t
334
335
for incoming files, set this to some hash algorithm, see
335
336
[ crypto.createHash] ( https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm_options )
336
337
for available algorithms
338
+ - ` options.fileWriteStreamHandler ` ** {function}** - default ` null ` , which by
339
+ default writes to host machine file system every file parsed; The function
340
+ should return an instance of a
341
+ [ Writable stream] ( https://nodejs.org/api/stream.html#stream_class_stream_writable )
342
+ that will receive the uploaded file data. With this option, you can have any
343
+ custom behavior regarding where the uploaded file data will be streamed for.
344
+ If you are looking to write the file uploaded in other types of cloud storages
345
+ (AWS S3, Azure blob storage, Google cloud storage) or private file storage,
346
+ this is the option you're looking for. When this option is defined the default
347
+ behavior of writing the file in the host machine file system is lost.
337
348
- ` options.multiples ` ** {boolean}** - default ` false ` ; when you call the
338
349
` .parse ` method, the ` files ` argument (of the callback) will contain arrays of
339
350
files for inputs which submit multiple files using the HTML5 ` multiple `
@@ -636,8 +647,8 @@ form.on('end', () => {});
636
647
637
648
If the documentation is unclear or has a typo, please click on the page's ` Edit `
638
649
button (pencil icon) and suggest a correction. If you would like to help us fix
639
- a bug or add a new feature, please check our
640
- [ Contributing Guide] [ contributing-url ] . Pull requests are welcome!
650
+ a bug or add a new feature, please check our [ Contributing
651
+ Guide] [ contributing-url ] . Pull requests are welcome!
641
652
642
653
Thanks goes to these wonderful people
643
654
([ emoji key] ( https://allcontributors.org/docs/en/emoji-key ) ):
0 commit comments