0
我使用EmailComposer插件将表单发送到自定义电子邮件。在表单中的某个时刻,用户将能够通过电子邮件从图库中拍照和/或上传图像。带附件的Phonegap EmailComposer不附带图片库中的图片
随着相机的图像,一切工作正常。问题在于它从手机库中取出。
这是我使用这样的上传代码:
function upGal() {
navigator.camera.getPicture(updatePhoto,
function() {
console.log('error')
}, {
quality: 50,
destinationType: 1,
sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY
}
);
}
的updatePhoto
功能做到这一点:
function updatePhoto(imageURI) {
//right here I include the image on this array, to be fowarded as attachment later
if (imageURI != 'nothing')
photoArray.push(imageURI);
//bellow here I just include an <img> tag with the imageURI as src
}
图像被成功列入作为标签,但是当我尝试发送电子邮件中,仅附加了相机拍摄的图像。
我错过了什么招数?
我得到“Object [object DOMWindow]没有方法'resolveLocalFileSystemURI'”,即使我在deviceReady之后调用它:s –
您是否安装了'file'插件? cordova插件添加org.apache.cordova.file –
是的,它也列在本地插件列表中。 –