1

I captured the image using following method:

 navigator.camera.getPicture(uploadImage, function (message) {}, {
    destinationType: navigator.camera.DestinationType.FILE_URI,
    sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY,
    mediaType: navigator.camera.MediaType.ALLMEDIA
 });

function uploadImage (imageURI){
   window.resolveLocalFileSystemURL(imageURI, function (fileEntry) {
    fileEntry.file(function(file){
         console.log('file type is ',file.type);
    },function(err){
      console.log('error in getting mime type ',err);
    });
   },
   function(err){
     console.log('error in resolving uri ',err);
   });
}

When i choose image / video from gallery i am getting URI like this

content://com.android.providers.media.documents/document/image%3A2119

then ultimately getting error error in resolving uri : error code 1000

Simply i need to get the MIME type of choosen file with URI like above.

I referred below links but no luck :(

one , two

help me to solve this .

Community
  • 1
  • 1
Saravanan
  • 317
  • 2
  • 6
  • 17
  • I found the another link which was useful [here](http://stackoverflow.com/questions/30928824/phonegap-resolvelocalfilesystemurl-does-not-work-for-content-uri-on-android) – Saravanan Jul 28 '15 at 01:50

0 Answers0