I am using AJAX to upload two images (in base64 encoding). It works perfectly fine if the images are small (e.g. 500kB one image and 300kB the other, <1MB in total). However, if the images are larger (e.g. 1.5MB and 300kB), the larger image is not recieved by PHP (only the other one can be seen). That suggests that a limit could be reached on the server side, however the PHP parameters post_max_size and upload_max_filesize are set to 256MB, so should not be a problem.
Any ideas what can be wrong?
Here is the ajax:
$.ajax({
url:'upload.php',
method:'POST',
contentType:"application/x-www-form-urlencoded",
data: {orig:original,image:cropped},
success:function(data)
{
$modal.modal('hide');
}
});
Here is the PHP code:
echo print_r($_POST);
Here is the PHP setup:
file_uploads On
max_execution_time 120
max_file_uploads 20
post_max_size 256M
upload_max_filesize 256M
After discussion with webhosting admins we discovered that the issue was caused by nginx limit client_max_body_size, which was set to 1MB.