Sending a 4mb file to backend via webMethod

Hi everyone,

I’m trying to send a base64 image to the backend of my site. I can do this successfully until that image is around 1mb in size. This is a tiny size, and I can’t imagine why Wix would be throwing a 413 error on this.

I’m just calling a backend webMethod function.

Where are you saving the image?

Is this a base64 string being saved in a CMS collection?

No, I’m not saving it at all! Just passing it as a parameter to a backend function exported as a webMethod. Then the backend function sends the modified image back to the frontend.

It works fine-- unless I try to pass a parameter to the backend that is around a few MB in size. I can pass small base64 strings to the backend no problem though.

Most likely the reason is the limitation of the request duration (from 14 to 59 seconds, depending on your plan) through webMethod.
Thus, during this time you do not have time to transfer a large amount of data to the backend and receive a response from the function).

That would make sense, except any other API that I hit with these images responds in <8 seconds. They aren’t sizeable by any means, so I’m wracking my brain to figure out why WebMethod appears to have such a tiny size limit on what I can send to the backend.