lightningasfen.blogg.se

Npm busboy
Npm busboy








Note: If you listen for this event, you should always consume the stream whether you care about its contents or not (you can simply do stream.resume() if you want to discard/skip the contents), otherwise the 'finish'/ 'close' event will never fire on the busboy parser stream. MimeType - string - The file's 'Content-Type' value. You are better off generating your own (safe) filenames, or at the very least using a hash of the filename.Įncoding - string - The file's 'Content-Transfer-Encoding' value. WARNING: You should almost never use this value as-is (especially if you are using preservePath: true in your config) as it could contain malicious input. info contains the following properties:įilename - string - If supplied, this contains the file's filename. base64 to raw binary) are done on the file's data. stream is a Readable stream containing the file's data. (Special) Parser stream eventsįile(name, stream, info) - Emitted for each new file found. For example, if the Content-Type in headers is missing entirely, is not a supported type, or is missing the boundary for 'multipart/form-data' requests. This function can throw exceptions if there is something wrong with the values in config. Default: 2000 (same as node's http module). HeaderPairs - integer - For multipart forms, the max number of header key-value pairs to parse. Parts - integer - For multipart forms, the max number of parts (fields + files).

npm busboy

Default: Infinity.įiles - integer - For multipart forms, the max number of file fields.

npm busboy

Default: Infinity.įileSize - integer - For multipart forms, the max file size (in bytes). Default: 1048576 (1MB).įields - integer - Max number of non-file fields. Default: 100.įieldSize - integer - Max field value size (in bytes). Valid properties are:įieldNameSize - integer - Max field name size (in bytes). Limits - object - Various limits on incoming data.

npm busboy

PreservePath - boolean - If paths in filenames from file parts in a 'multipart/form-data' request shall be preserved. filename) that are not extended parameters (that contain an explicit charset). Default: 'utf8'.ĭefParamCharset - string - For multipart forms, the default character set to use for values of part header parameters (e.g. Default: node's stream.Readable default.ĭefCharset - string - Default character set to use when one isn't defined. Default: node's stream.Writable default.įileHwm - integer - highWaterMark to use for individual file streams. HighWaterMark - integer - highWaterMark to use for the parser stream. Headers - object - These are the HTTP headers of the incoming request, which are used by individual parsers. ( function )(config) - Creates and returns a new Writable form parser stream. createServer ( ( req, res ) => ) API Exports Const http = require ( 'http' ) const busboy = require ( 'busboy' ) http.










Npm busboy