3
我已经在我的iPad 内置的PhoneGap的应用程序与1.6版本的一套ULR到一个XPage Domino服务器上如何从手机图片获取图片到远程XPage?
现在我的问题:
当我拍张照片在iPhone和上传它使用功能takePicture
的“返回值”我的XPage 是这样
data:image/jpeg;base64,file://localhost/var/mobile/Applications/C1ABCAD3-5F54-45AB-81B0-A242940B58CB/tmp/photo_001.jpg
一个String有没有机会得到上传的文件,而不是字符串?
这里是我使用的代码:
XSP.submitLatency = 300*1000;
function takePicture() {
navigator.camera.getPicture(displayPicture,
showError,
{ quality: 50 }
);
}
function displayPicture(data) {
alert("Hallo");
var imagePanel = document.getElementById('imagePanel');
imagePanel.style.display = "";
imagePanel.style.position = "absolute";
imagePanel.style.top = "250px";
imagePanel.style.left = "0px";
alert("data:image/jpeg;base64," + data)
document.getElementById('image').src = "data:image/jpeg;base64," + data;
document.getElementById("#{javascript:getClientId('inputHidden1')}").value = "data:image/jpeg;base64," + data;
document.getElementById("#{javascript:getClientId('button1')}").disabled = false;
}
function showError(fail) {
alert(fail);
}
啊谢谢,但是我通过destinationType:Camera.DestinationType.DATA_URL得到了答案,它应该返回一个Base64编码的图像而不是FilePath。 – 2012-04-13 08:09:10
我想你遇到了1.6.0中的bug,应该在1.6.1中修复。你在iOS上对吗? – 2012-04-16 19:13:32
参数确定我使用的1.6不是1.6.1。在iOS上是即时通讯 – 2012-04-17 13:04:06