I am trying to upload an image to Cloudinary by way of a Netlify Function. I am sending the base64 encoded string representation of an image file from the browser to the serverless function. This call crashes occasionally when the max POST body size is exceeded (with a hi-res image).
Is there a formal limit in the documentation somewhere for how big the data in the POST body can be?
That’s a curious issue. I’ve checked with a colleague and we’ve seen functions accept up to 6mb files. That said, I think you might be more likely running into the function runtime limit of 10 seconds. Could you perhaps get the request-id of a request that failed as you described?
I’m wondering if there is a stated limit somewhere as James originally asked for? I get an error immediately with a base64 encoded image that is 4.69 MB. Smaller images are fine. I’m going to see if I can find the threshold.
Here’s the specific error: Error: Stream body too big
at IncomingMessage.onData (C:\Users\DaveGray\AppData\Roaming\npm\node_modules\netlify-cli\src\utils\create-stream-promise.js:24:16)
Hi, @gitdagray and @jamesqquick. The limit for a POST with a Function is determined by the limits of the underlying infrastructure. That infrastructure is AWS Lambda and the limits are listed here: