JQuery ajax POST size-limit/cutoff
I am logging a lot of data using a frontend which then uses jquery ajax to POST to php to store in a mysql database. While this seems to work typically, I am running into trouble with the variable I am sending through getting cut off. The jquery code is just:
$.ajax({
url: "urlhere",
data: ({answer: JSON.stringify(frames)}),
success: ...
});
On php end I get the variable ($answer = $_POST["answer"];
) and then a开发者_如何学Cdd it to the database as usual (the database field is a text field so I doubt I am hitting a limit there).
Any help would be appreciated, thanks!
[[[[I figured it out. It was my text field in my sql table that is too small! Made it MEDIUMTEXT and now the world is good. Thanks for all your help!!]]]]
Have you checked your php.ini definitions.
You can adjust post_max_size to whatever you need.
Also check if you are using SUHOSIN. It implements some limitations on post variables. See below the recommendation from my phpmyadmin installation in case you are using it.
suhosin.request.max_vars should be increased (eg. 2048)
suhosin.post.max_vars should be increased (eg. 2048)
suhosin.request.max_array_index_length should be increased (eg. 256)
suhosin.post.max_array_index_length should be increased (eg. 256)
suhosin.request.max_totalname_length should be increased (eg. 8192)
suhosin.post.max_totalname_length should be increased (eg. 8192)
suhosin.sql.bailout_on_error needs to be disabled (the default)
suhosin.log.* should not include SQL, otherwise you get big slowdown
I hope this helps. Good luck!
精彩评论