我在 iPad 上构建了一个 1.6 版的 Phonegap 应用程序,并将 ulr 设置为 Domino 服务器上的 XPage
现在我的问题:
当我在 iPhone 上拍照并使用函数将其上传到我的 XPage 时takePicture
,“返回值”是这样的字符串
data:image/jpeg;base64,file://localhost/var/mobile/Applications/C1ABCAD3-5F54-45AB-81B0-A242940B58CB/tmp/photo_001.jpg
有没有机会上传文件而不是字符串?
这是我正在使用的代码:
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);
}