title: Phonegap image upload fails, permission denial
body: <p>I've been trying to upload images from the device gallery to an external server, but i get this error:</p>
  
  <pre><code>04-18 12:11:25.680: W/System.err(19045): java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaDocumentsProvider uri content://com.android.providers.media.documents/document/image26952 from pid=19045, uid=10243 &gt;requires android.permission.MANAGE_DOCUMENTS, or grantUriPermission()
  </code></pre>
  
  <p>I added this permission in the Android Manifest, but it did not change anything. Also, I can load images and display them without any trouble, it is just the upload part that fails.</p>
  
  <p>Here's the code I have: </p>
  
  <pre><code>function uploadPhoto(src) {
      var options = new FileUploadOptions();
      options.fileKey="file";
      options.fileName=src.substr(src.lastIndexOf('/')+1);
  
      var ft = new FileTransfer();
      ft.upload(src, encodeURI("http://xxxx/upload.php"), win, fail, options);
  }
  </code></pre>
  
  <p>I have android kitkat latest version, and I'm running this on Nexus 5. Phonegap version is 3.3.</p>
  
  <p>Any idea on how to deal with this error?</p>
  
  <p>Thank you.</p>
  
  <p>PS: here are the permissions in the android manifest xml</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.RECORD_AUDIO" /&gt;
  &lt;uses-permission android:name="android.permission.MANAGE_DOCUMENTS" /&gt;
  &lt;uses-permission android:name="android.permission.RECORD_VIDEO" /&gt;
  &lt;uses-permission android:name="android.permission.SEND_SMS" /&gt;
  &lt;uses-feature android:name="android.hardware.telephony" android:required="false" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  &lt;uses-permission android:name="android.permission.VIBRATE" /&gt;
  &lt;uses-permission android:name="android.permission.MANAGE_DOCUMENTS" /&gt;
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  </code></pre>