title: How to solve Permission Denial: reading com.android.providers.downloads.DownloadStorageProvider
body: <p>I'm using react-native-document-picker to get file from android device and upload them. I was able to pick a file and upload normally but only from folder inside My File. If I pick a file in others directory, for example, Recent (the one display first when open the Document picker) the app would stop immidiately and display error:</p>
  <p><em>Permission Denial: reading com.android.providers.downloads.DownloadStorageProvider uri content://com.android.providers.downloads.documents/document/msf:3239 from pid=19089, uid=10372 requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs</em></p>
  <p>despite it is the same file storaged in My File.
  I used react-native-image-crop-picker and was able to pick image in any directory.</p>
  <p>Below is the code of my manifest file and document picker function:</p>
  <p>---------------AndroidManifest----------------
  </p>
  <pre><code>&lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.CAMERA&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.RECORD_AUDIO&quot;/&gt;
  &lt;uses-permission android:name=&quot;android.permission.READ_EXTERNAL_STORAGE&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.READ_INTERNAL_STORAGE&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.WRITE_INTERNAL_STORAGE&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.ACCESS_FINE_LOCATION&quot; /&gt;
  &lt;application
    
    android:name=&quot;.MainApplication&quot;
    android:label=&quot;@string/app_name&quot;
    android:icon=&quot;@mipmap/ic_launcher&quot;
    android:roundIcon=&quot;@mipmap/ic_launcher_round&quot;
    android:allowBackup=&quot;false&quot;
    android:theme=&quot;@style/AppTheme&quot;&gt;
    &lt;meta-data
      android:name=&quot;com.google.android.geo.API_KEY&quot;
      android:value=&quot;AIzaSyCeZH6swcDYvYWT78RhSAQYbE1m_Gt2VXs&quot;/&gt;
    &lt;uses-library android:name=&quot;org.apache.http.legacy&quot; android:required=&quot;false&quot;/&gt;
    &lt;activity
      android:name=&quot;.MainActivity&quot;
      android:label=&quot;@string/app_name&quot;
      android:configChanges=&quot;keyboard|keyboardHidden|orientation|screenSize|uiMode&quot;
      android:launchMode=&quot;singleTask&quot;
      android:screenOrientation=&quot;portrait&quot;
      android:windowSoftInputMode=&quot;adjustPan&quot;&gt;
      &lt;intent-filter&gt;
          &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;
          &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;
      &lt;/intent-filter&gt;
    &lt;/activity&gt;
    &lt;activity android:name=&quot;com.facebook.react.devsupport.DevSettingsActivity&quot; /&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p>---------------DocumentPickerFunction----------------</p>
  <pre><code>  let arrFile: FileUploadParam[] = [];
  
    let pickFile = async () =&gt; {
      
  DocumentPicker.pick({
        type: [DocumentPicker.types.allFiles],
      }).then((file: any) =&gt; {
        
  arrFile.push(
          fileStorageService.createFileUploadParam(file.name, file.uri, false),
        );
  
        fileStorageService.uploadChatAttachs(arrFile).subscribe((result) =&gt; {
          let urlArr: MessageAttach[] = [];
          result.map((item: any) =&gt; {
            urlArr.push({
              name: item.name,
              storage_filename: item.storage_filename,
              url: item.url,
              type: AttachType.FILE,
            });
          });
  
          chatService
            .sendAttachFileMessage('', urlArr, roomId)
            .subscribe((message) =&gt; {});
          console.log('Upload data', urlArr);
        });
      });
    };
  </code></pre>