[ 
https://issues.apache.org/jira/browse/CB-6300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13939554#comment-13939554
 ] 

Ian Clelland commented on CB-6300:
----------------------------------

The encoding error, in this case, means that there are no installed file 
systems which can handle that particular file location. Neither the temporary 
or persistent file systems consider that directory to be within their root. I'm 
looking into why the camera plugin would be saving images in a place that the 
file plugin does not recognize as a storage location.

In the meantime, you can try installing the 
org.apache.cordova.file-system-roots plugin (it's been in the cordova-plugins 
repository, but I just published it now), and add this to your config.xml:

{code}
<preference name="AndroidExtraFilesystems" 
value="files,files-external,documents,sdcard,cache,cache-external,root" />
{code}

> window.resolveLocalFileSystemURL weirdness
> ------------------------------------------
>
>                 Key: CB-6300
>                 URL: https://issues.apache.org/jira/browse/CB-6300
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, CordovaJS, Plugin File
>    Affects Versions: 3.3.0
>         Environment: file plugin 1.0.1
>            Reporter: nii amon dsane
>              Labels: camera, file, newbie, plugin, resolveLocalFileSystemURL
>
> I am trying to use the window.resolveLocalFileSystemURL but for some reason 
> my failure callback is always triggered. The success callback is never 
> triggered. This is my code:
> // Take a picture using the camera
> $scope.takePicture = function () {
>     var options = {
>       quality: 100,
>       targetWidth: 500,
>       targetHeight: 500,
>       destinationType: Camera.DestinationType.FILE_URI,
>       encodingType: Camera.EncodingType.JPEG,
>       saveToPhotoAlbum: true,
>       correctOrientation: true,
>       sourceType: Camera.PictureSourceType.CAMERA,
>       allowEdit: true
>     };
>     navigator.camera.getPicture(
>       cameraSuccess,
>       cameraFailure,
>       options
>     );
>     return false;
>   };
>   // what to do when the camera has  successfully yielded a good image
>   function cameraSuccess(imageURI){
>     var uri = 'cdv' + imageURI;
>     alert('this is imageURI: ' + imageURI);
>     window.resolveLocalFileSystemURL(imageURI, resolvePhotoPath, fail);
>   };
>   When I print out the imageURI, I get something like this:
>   file:///storage/sdcard0/DCIM/Camera/1395126124474.jpg
>   I can confirm that when I look at that path using the Files application on 
> an   android, the file is indeed there. But when the code runs and it 
> executes the window.resolveLocalFileSystemURL, the fail callback is always 
> triggered with an error of {"code":5}.
> I've seen that that means there's an ENCODING_ERR but a bit baffled as to 
> what is causing that. The file does save properly to that location so I am at 
> a loss at to why the code will fail.
> Any help here?



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to