title: Using PhoneGap, How to get base64 image data of the photo chosen from photo library in iPhone
body: <p>Using PhoneGap(Cordova), Am trying to get base64 image data of the photo chosen from the photo library. </p>
  
  <p>I could do that.. when the photo is captured from camera, With the below snippet of code in Cordova. </p>
  
  <pre><code>    navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
      destinationType: Camera.DestinationType.DATA_URL
   }); 
  
  function onSuccess(imageData) {
      var image = document.getElementById('myImage');
      image.src = "data:image/jpeg;base64," + imageData;
  }
  
  function onFail(message) {
      alert('Failed because: ' + message);
  }
  </code></pre>
  
  <p>But, what should i do to get the base64 image data when the photo gets chosen from library?</p>