kumar psk
kumar psk

Reputation: 11

Issue with resolving the file url in windows 8 using Cordova

I am developing a windows 8 app. I am using cordova plugins to capture image and upload to server. But when I am resolving the file url using

window.resolveLocalFileSystemURL(fileURI, onResolveSuccess,onResolveFail);

It gets fail with error code - 5.

file URI is like-

ms-appdata:///local/picture001.jpg - when captured image

blob:1439104B-EB70-4731-8039-9493259BCC4B - when select from existing images

what path should be there and how it will come.

Thanks in advance.

Upvotes: 1

Views: 392

Answers (2)

ayok
ayok

Reputation: 31

I don't know whether you have solved this, but my solution is that I don't get that blob and I don't use that resolveLocalFileSystemURL. I just change option destinationType value in navigator.camera.getPicture when selecting existing file on windows phone to NATIVE_URI, so it becomes:

navigator.camera.getPicture(onPhotoURISuccess, onFail, { 
  quality: 50, 
  destinationType: destinationType.NATIVE_URI,
  sourceType: source 
});

So instead of blob, I got good image with URL.

Upvotes: 0

scott dickerson
scott dickerson

Reputation: 906

You should pass a url like this to cordova on Windows.

fileURI = fileURI.replace("ms-appdata:///local/", Windows.Storage.ApplicationData.current.localFolder.path + "\\");

Upvotes: 1

Related Questions