[Error: Download manager failed to download from Status Code = 16]

See original GitHub issue

Hi everyone

I try to download file and open it. For open i use FileViewr.opne(). To download i use :

options = {
                  addAndroidDownloads: {
                      fileCache: true,
                      useDownloadManager: true,
                      notification : true,
                      path: DownloadDir + pdfId + '.pdf'
                      description: 'Downloading file...',
                      overwrite : true,
                      title:"Health Records",
                      indicator:true
                  }

RNFetchBlob.config(options)
          .fetch('GET', fileUrl)
          .then((res) => {
               FileViewr.opne(res.data);
          }) 
          .then (()=>{
              console.log("")
          }) 
          .catch((error)=> console.log(error))

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:4
  • Comments:28

github_iconTop GitHub Comments

10reactions
Ashkan-Oliaiecommented, May 28, 2020

I’m facing this issue , I can download the file in chrome using the url , but in RNFB I get the statusCode=16

9reactions
Maddumagecommented, Jul 20, 2019

Finally, this worked for me

downloadFile = () => { if (this.isConnected) { const dirs = RNFetchBlob.fs.dirs; const android = RNFetchBlob.android RNFetchBlob.config({ fileCache: true, addAndroidDownloads: { useDownloadManager: true, mime: ‘application/pdf’, notification: true, mediaScannable: true, title: ‘test.pdf’, path: ${dirs.DownloadDir}/test.pdf }, }) .fetch(‘GET’, ‘https://download.novapdf.com/download/samples/pdf-example-encryption.pdf’, { ‘Cache-Control’: ‘no-store’ }) .then((res) => { if (Platform.OS = ‘android’) { android.actionViewIntent(res.path(), ‘application/pdf’) } }) .catch((e) => { console.log(e); }); } else { alert(‘Please check your internet connection’); } }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Download Manager gives error code 16 with rn-fetch-blob
According to their readme, you need to add the DOWNLOAD_COMPLETE action when using the download manager.
Read more >
Download manager failed to download from Status Code = 16
I try to download file and open it. For open i use FileViewr.opne(). To download i use :
Read more >
DownloadManager | Android Developers
The download manager is a system service that handles long-running HTTP ... If an HTTP error occurred, this will hold the HTTP status...
Read more >
Error codes in Device Manager in Windows - Microsoft Support
Lists the error codes that may be reported by Device Manager and the possible ... Code 16 “Windows cannot identify all the resources...
Read more >
DownloadManager.Request - Android Developers
Control whether a system notification is posted by the download manager while this ... Content and code samples on this page are subject...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found