【问题标题】:How to Upload image on server using webservice in titanium android/iOS?如何在 Titan android/iOS 中使用 web 服务在服务器上上传图像?
【发布时间】:2012-12-06 18:17:33
【问题描述】:

我想将图像转换为 base64 格式,然后将其上传到服务器上,但 base64 字符串太大,以至于它在网络上给我错误,即未收到参数。任何想法使用发送完整字符串到服务器下面的网络服务?这是我尝试过的以下服务。

var xhrAddclient = Titanium.Network.createHTTPClient();
    xhrAddclient.open('POST', webservice_url);
    xhrAddclient.send({
        method : "addclient",
        image : base64string,
    });

    xhrAddclient.setTimeout(10000);

    xhrAddclient.onerror = function() {
        showAlertBox('Service timed out. Please try again.');

    };

    xhrAddclient.onload = function() {
        showAlertBox("Client added successfully.");


    };

【问题讨论】:

    标签: android image web-services titanium base64


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 2012-09-29
      • 2019-08-10
      • 1970-01-01
      • 1970-01-01
      • 2015-11-26
      • 2021-03-18
      • 2017-02-03
      • 1970-01-01
      相关资源
      最近更新 更多