Web Messaging SDK file upload 413 vs MIME rejection

We’ve got a custom Web Messaging implementation and I’m hitting a wall with customer file uploads. The docs say the max size is 5MB, but I’m getting a 413 Payload Too Large on a 2.4MB PDF. I’m using the standard sendFile method from the SDK, passing the file object directly. The request hits our backend webhook, which just logs the payload and returns a 200. No validation logic on our end yet, just trying to get the raw data through.

Checked the network tab. The Content-Type header is set to multipart/form-data. The payload looks fine. Tried increasing the nginx client_max_body_size to 10M, no change. Still getting 413. Is there a hidden limit in the Genesys Cloud Web Messaging service itself before it even hits our webhook? Or is this a SDK configuration issue I’m missing? Here’s the snippet we’re using to trigger the upload.

Check your nginx config. Default client_max_body_size is 1MB. You’ll need to bump it higher than 5MB to account for base64 encoding overhead. The SDK encodes files as base64 strings in the JSON payload, which inflates the size by ~33%. A 2.4MB PDF becomes roughly 3.2MB. Set client_max_body_size 5m; in your server block.