簡體   English   中英

通過Ajax發布Base64圖像數據-數據截斷

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

我正在嘗試通過Ajax將Base64圖像數據發送到服務器。 有時所有圖片都可以制作,其他時候只有少數可以制作。

關於錯誤檢查服務器是否已接收所有數據的任何想法?

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);

可能的問題是您正在發送的數據量。 服務器對數據有限制,可以立即發送。 而php(如果您使用的是php)則有這樣的限制。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM