Search code examples
javascriptphpxmlhttprequest

What is the maximum data size with xmlhttp GET


I tried to send my image to the server with xmlhttp. It turns out that it does not work with an dataURL. Is this because of a maximum data size for Get requests?

var drawing = document.getElementById("canvas");
var dataURL = drawing.toDataURL();
xmlhttp.open("GET","upload.php?data_sheet=" + dataURL, true);

Solution

  • Do you know how long the content of the dataURL is?

    The maximum length of a URL is 2048 characters - if it exceeds the maximum length, it will simply cut off the overflow.