[Error: Download manager failed to download from Status Code = 16]
See original GitHub issueHi 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:
- Created 5 years ago
- Reactions:4
- Comments:28
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m facing this issue , I can download the file in chrome using the url , but in RNFB I get the statusCode=16
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’); } }