简体   繁体   English

通过Ajax发布Base64图像数据-数据截断

[英]Posting Base64 Image Data via Ajax - Data Truncating

I am attempting to send Base64 image data via ajax to Server. 我正在尝试通过Ajax将Base64图像数据发送到服务器。 Sometimes all the pics make it, other times only aa few make it. 有时所有图片都可以制作,其他时候只有少数可以制作。

Any ideas for error checking that all the data is received by the server? 关于错误检查服务器是否已接收所有数据的任何想法?

http.open("post", URL, true);

http.onreadystatechange =   function()
{ 
     if(http.readyState  == 4)
     {
          if(http.status  == 200) {
              alert(http.responseText);
          alert("eReport Successfully sent to Server " + CustID +" "+name +" "+ListType);
          //clearCurrentReport();
          removeReport(CustID, ListType);
          } 


           //   alert("Received:"  + http.responseText); 
          else 
             alert("Report NOT SENT. Error Communicating with Server.  Please try again when you have a connection." );
     }
}; 

params = custid="+CustID+"&photo1="+pic1+"&photo2="+pic2+"&photo3="+pic3+"&photo4="+pic4+"&photo5="+pic5+"&photo6="+pic6;

http.send(params);

A possible problem is the amount of data you are sending. 可能的问题是您正在发送的数据量。 The server has a limit for the data, that can be sent at once. 服务器对数据有限制,可以立即发送。 And php ( if you are using php ) has such a limit. 而php(如果您使用的是php)则有这样的限制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM