So, I have this Ajax script with a PHP script in which I upload photos to the server.
This is the Ajax:
$.ajax(
{
type: "POST",
url: "formImage.php",
dataType:"json",
xhr: function()
{
var myXhr = $.ajaxSettings.xhr();
if(myXhr.upload)
{
myXhr.upload.addEventListener('progress',progress, false);
}
return myXhr;
},
data: {info: info },
beforeSend : function ()
{
//
},
contentType: "application/x-www-form-urlencoded;charset=UTF-8", success: function(result)
{
}
});
I send an array to a PHP script, when I echo out the result on the PHP script, on the console log I get POST Content-Length exceeded, what I am doing is I grab multiple base64 image code and concatenate it into a string but separate them with "-" which I store in info[0].
I tried sending a photo at a time to the PHP script and it works, but that is really inefficient because if I have let's say 300 photos loaded, I can't do an Ajax request for each of them, I want to grab the whole 300 photos base64 code and send it as one string. Can anyone help me ?