diff --git a/docs/Reference.md b/docs/Reference.md index 1279aa436..42614be3b 100755 --- a/docs/Reference.md +++ b/docs/Reference.md @@ -489,15 +489,18 @@ The following options are available when adding a route: be any result value accepted by [`reply()`](#replyresult). - `payload` - determines how the request payload is processed: - - `output` - the type of payload representation requested where: - - `data` - the incoming payload is read fully into memory. If `parse` is `true`, the payload is parsed (JSON, form-decoded, + - `output` - the type of payload representation requested. The value must be one of: + - `'data'` - the incoming payload is read fully into memory. If `parse` is `true`, the payload is parsed (JSON, form-decoded, multipart) based on the 'Content-Type' header. If `parse` is false, the raw `Buffer` is returned. This is the default value except when a proxy handler is used. - - `stream` - the incoming payload is made available via a `Stream.Readable` interface. If the payload is 'multipart/form-data' and + - `'stream'` - the incoming payload is made available via a `Stream.Readable` interface. If the payload is 'multipart/form-data' and `parse` is `true`, fields values are presented as text while files are provided as streams. File streams from a 'multipart/form-data' upload will also have a property `hapi` containing `filename` and `headers` properties. - - `file` - the incoming payload in written to temporary file in the directory specified by the server's `payload.uploads` settings. - If the payload is 'multipart/form-data' and `parse` is `true`, fields values are presented as text while files are saved. + - `'file'` - the incoming payload in written to temporary file in the directory specified by the server's `payload.uploads` settings. + If the payload is 'multipart/form-data' and `parse` is `true`, fields values are presented as text while files are saved. Note that + it is the sole responsibility of the application to clean up the files generated by the framework. This can be done by keeping track + of which files are used (e.g. using the `request.app` object), and listening to the server `'response'` event to perform any needed + cleaup. - `parse` - can be `true`, `false`, or `gunzip`; determines if the incoming payload is processed or presented raw. `true` and `gunzip` includes gunzipping when the appropriate 'Content-Encoding' is specified on the received request. If parsing is enabled and the 'Content-Type' is known (for the whole payload as well as parts), the payload is converted into an object when possible. If the