Welcome Guest, Not a member yet? Register   Sign In
jquery ajax POST size limit?
#1

[eluser]Unknown[/eluser]
I'm using jquery to send text back to my ajax.php controller like this:

Code:
var dataString = "1234567890";      
$.post(
    '../ajax/save_event',
    { data: dataString },
    function(){
        alert("success");
    },
    "text");

It works well, that is until the dataString gets to be ~3500 characters long. At that upper limit (just 3.5 KB?!!!), the $_POST received by ajax.php is NULL. Why?

(My php.ini post_max_size = 64M, so it's not that.)
#2

[eluser]Unknown[/eluser]
I figured it out. For some reason NetBeans' debugger tells me $_POST['data'] is null, but it's not. To manually determine the size of the $_POST received, I used these calls:

Quote:$request = http_build_query($_POST);
$size = strlen($request);

Also, I was putting $_POST['data'] into CodeIgniter's session:

Quote:$event_array = array('event' => $_POST['data']);
$this->session->set_userdata($event_array);

Which was coming up empty leading me to further believe that $_POST was empty. But the problem was instead is $this->session, which apparently has a 4K size limit (according to this post).




Theme © iAndrew 2016 - Forum software by © MyBB