I got some trouble sending long text strings via html forms.
I want to send image data uri to a php page there can handle the data and save it in MySQL.
Image data example:
data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfO..
The data is coming from a clipboard paste function I have on the page.
I have no problem in saving the data on the php page, but getting the data to the page makes trouble.
The script below is the one i try use to send the data from the client page:
formData = new FormData();
formData.append('imagedata','data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfO..');
$.ajax({
url: "test.php?reportid=1",
type: "POST",
cache: false,
contentType: false,
processData: false,
data: formData
}).done(function(e){
alert(e);
});
It works fine if the image size is small, but if i got an image above 250KB, it loose data during the post.
Maybe someone has a better way to post the data to the server?