From 4bc82c4e15087e6d36e1639e745c2ac0bbde9082 Mon Sep 17 00:00:00 2001 From: will Farrell Date: Sat, 13 Apr 2024 09:51:09 -0600 Subject: [PATCH] docs: add in mention how to use with images --- website/docs/middlewares/http-multipart-body-parser.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/middlewares/http-multipart-body-parser.md b/website/docs/middlewares/http-multipart-body-parser.md index 52d656e5c..366c27493 100644 --- a/website/docs/middlewares/http-multipart-body-parser.md +++ b/website/docs/middlewares/http-multipart-body-parser.md @@ -21,10 +21,10 @@ npm install --save @middy/http-multipart-body-parser ## Options - `busboy` (`object`) (optional): defaults to `{}` and it can be used to pass extraparameters to the internal `busboy` instance at creation time. Checkout [the official documentation](https://www.npmjs.com/package/busboy#busboy-methods) for more information on the supported options. -- `charset` (string) (default `utf8`): it can be used to change default charset. +- `charset` (string) (default `utf8`): it can be used to change default charset. Set to `binary` when recieving images. - `disableContentTypeError` (`boolean`) (optional): Skip throwing 415 when `Content-Type` is invalid. Default: `true`, will default to `false` in next major version. -**Note**: this middleware will buffer all the data as it is processed internally by `busboy`, so, if you are using this approach to parse significantly big volumes of data, keep in mind that all the data will be allocated in memory. This is somewhat inevitable with Lambdas (as the data is already encoded into the JSON in memory as Base64), but it's good to keep this in mind and evaluate the impact on you application. +**Note**: this middleware will buffer all the data as it is processed internally by `busboy`, so, if you are using this approach to parse significantly big volumes of data, keep in mind that all the data will be allocated in memory. This is somewhat inevitable with Lambdas (as the data is already encoded into the JSON in memory as Base64), but it's good to keep this in mind and evaluate the impact on you application. If you really have to deal with big files, then you might also want to consider to allowing your users to [directly upload files to S3](https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-UsingHTTPPOST.html) ## Sample usage