cordova ionic图库中的图像上载问题。选择取消错误

cordova ionic图库中的图像上载问题。选择取消错误,cordova,ionic-framework,Cordova,Ionic Framework,我正在android平台上使用ionic cordova库进行图像上传的示例应用程序。当我第一次安装应用程序时,图像上传的很好。之后,显示错误选择已取消。谁能帮我一下什么时候会发生这个错误,为什么会发生 变量选项={ 质量:50, destinationType:Camera.destinationType.FILE\u URI, 源类型:Camera.PictureSourceType.PHOTOLIBRARY, 允许:是的, 编码类型:Camera.encodingType.JPEG, po

我正在android平台上使用ionic cordova库进行图像上传的示例应用程序。当我第一次安装应用程序时,图像上传的很好。之后,显示错误选择已取消。谁能帮我一下什么时候会发生这个错误,为什么会发生

变量选项={ 质量:50, destinationType:Camera.destinationType.FILE\u URI, 源类型:Camera.PictureSourceType.PHOTOLIBRARY, 允许:是的, 编码类型:Camera.encodingType.JPEG, popoverOptions:CamerapoverOptions, saveToPhotoAlbum:false }; var image=document.getElementById'tempImage'; console.logimages:; console.logimage; $cordovaCamera.getPictureoptions.thenfunctionimageData{ //console.logimageData; //控制台。登录选项; var image=document.getElementById'tempImage'; image.src=图像数据; 变量服务器=http://yourdomain.com/upload.php, filePath=imageData; var日期=新日期; 变量选项={ fileKey:file, 文件名:imageData.substrimageData.lastIndexOf'/'+1, chunkedMode:false, mimeType:image/jpg }; $cordovaFileTransfer.uploadserver、文件路径、选项.thenfunctionresult{ console.logSUCCESS:+JSON.stringifyresult.response; console.log'Result\'+Result.response[0]+''u ending'; 成功; alertJSON.stringifyresult.response; },函数{ console.logERROR:+JSON.stringifyerr; //alertJSON.stringifyerr; },功能进展{ //不断更新进度 }; },函数{ //错误 alerterr; console.logerr; };
多亏了我。我能自己解决这个问题。这对我来说是个坏消息,因为我在视图部分使用了输入类型文件。所以它取消了错误选择。相反,使用一个按钮调用函数来打开图像库部分,其余部分在我这边工作正常。希望此答案对其他人有所帮助。

请告诉我错误总是发生的原因。提前谢谢!