开发者

Posting Base64 Image Data via Ajax - Data Truncating

I am attempting to send Base64 image data via ajax to Server. Sometimes all the pics make it, other times only a a 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:"  +开发者_StackOverflow中文版 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜