【发布时间】: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