简体   繁体   English

MoSync重新加载-captureImage

[英]MoSync Reload - captureImage

I am developing an app using Mosync Reload 3.3 and I am having issues using the captureImage function to let a phone take a photo and upload it to my server. 我正在使用Mosync Reload 3.3开发一个应用程序,并且在使用captureImage函数让手机拍照并将其上传到我的服务器时遇到问题。

Firstly, I only have a Google Nexus 4 for testing and it is not jailbroken. 首先,我只有一个用于测试的Google Nexus 4,而且它没有越狱。 When I call the image capture function: 当我调用图像捕获功能时:

navigator.device.capture.captureImage(function(mediaFiles){ 
        alert(JSON.stringify(mediaFiles)); 
    }, function(error) { 
        alert('An error occurred during capture: ' + error.code); 
    }, {limit: 2}
);

My phone lets me take a photo, but in the mediaFiles object that is returned to the success function, the image path doesn't exist on my phone when I try and navigate there. 我的手机可以拍照,但是在返回到成功功能的mediaFiles对象中,尝试在其中导航时,手机上不存在图像路径。 The path says '/data/data/com.mosync.app_ReloadClient/files/saved/RLDPRJmyTestApp/image000.jpg'. 路径显示为“ /data/data/com.mosync.app_ReloadClient/files/saved/RLDPRJmyTestApp/image000.jpg”。 When I go to the data folder on my phone it is empty, if I try to create another nested data folder it says file already exists so I guess it could just be a hidden folder I don't have access to? 当我转到手机上的数据文件夹时,它是空的,如果我尝试创建另一个嵌套的数据文件夹,它会说文件已经存在,所以我猜它可能只是我无法访问的隐藏文件夹?

Anyway, I can't progress further as when I try to upload the file I get an error message from FileTransfer , outputting error code 1 which means the file was not found. 无论如何,我无法继续前进,因为当我尝试上传文件时,我从FileTransfer收到一条错误消息,输出错误代码1,这意味着未找到该文件。

Has anyone had any similar issues who can offer any advice as to what is going wrong? 有谁遇到过类似的问题,可以针对发生的问题提供任何建议?

确保您已检查应用程序的存储权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM