1

I would like to send very long string (about 1 200 000 chars) from my jQuery script to PHP server. I created code:

$.ajax({
    url : 'con.php',
    async : false,
    type : 'POST',
    data : 'require='+parameters
}).done(function(result) {
    console.log(result);
});

where parameters is describing string and in PHP:

if ($_POST['require']){
echo 'ok';
}

When I'm sending normal-size string everything is good, but when I sent my big string I got the error message:

Notice: Undefined index: require

I setup memory_limit in my php.ini to 500M and still get nothing.

I tried to use [suhosin][1] with setting up suhosin.memory_limit greater than 0 with same results as above.

How can I resolve my problem?

5

1 Answer 1

1

Try having your data sent like this:

data: {
    require: parameters
}

and set your php max post sizes:

post_max_size=20M
upload_max_filesize=20M
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.