【发布时间】:2014-02-12 19:11:31
【问题描述】:
我正在使用 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
}
图片被成功添加为标签,但是当我尝试发送电子邮件时,只附加了相机拍摄的图片。
有什么我遗漏的技巧吗?
【问题讨论】:
标签: javascript android cordova phonegap-plugins