What is the max length string I can send in a $_POST API Call?
I have a Base64 string (Image Data) I am trying to send / do some conversions from Base64 >> Image and save the file.
My problem is that only half of the image is displaying and by looking at the Returned value, the Base64 is getting cut in half (losing a bunch of characters after).
I believe the POST may have a limit (or string) and am trying to figure out how to increase this or a work around.
Can you share your API Action window? I want to see how you’re filling the parameters
Looking at the web, the string length limit may be around the order of 200 MB at least. Certainly, you’re not exceeding that, leading to the conclusion this may be specific to Wappler
The code produces the same result even if just using the $_POST.blob data so I am not sure on this if it’s causing issues or not but would appear not to be the issue from what your saying with 4MB limit.
You don’t mention what server technology you are using, guessing node however generally the max post size can be set at server level.
In PHP the value can be set in php.ini like this
post_max_size="512M"
I believe it may also work from your .htaccess file with
The maximum post size depends on the web server configuration, but when you exceed it you would normally get an http error and not get half of the data. Not sure if the JSON parser has some limit, I don’t think it has.
First thing is to check if the options.base64 parameter is correct or that it indeed contains only partial the submitted data.
Do you know in which format the data is being send, can be as application/x-www-form-urlencoded, multipart/form-data or application/json. Depending on the content-type it is differently parsed on the server. For example multipart/form-data also supports binary file uploads.
The urlencoded and json are parsed using the body-parser middleware in express. Default limit seems to be 100KB here.
The multipart/form-data is being parsed by the express-fileupload middleware. That seems to use Busboy where you can set different limits. In their documentation I see the max field value size is 1MB. This seems to match exactly with your cut-off data.