Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to download file from app cache using Download Manager #324

Closed
konchak007 opened this issue Dec 14, 2023 · 4 comments
Closed

Comments

@konchak007
Copy link

konchak007 commented Dec 14, 2023

I'm doing POST api call, send data
And receive from backend file(base64) pdf
If I use Download Manager in config = receive an error 16
Mb there is solution to save this file inside cache and after that to download to user folder ?

I

const res = await RNFetchBlob.config({
      addAndroidDownloads: {
        useDownloadManager: true,
      },
    }).fetch(
      'POST',
      url,
      {
        'Transfer-Encoding': 'Chunked',
        'access-token': token || '',
        'Content-Type': 'application/json',
      },
      JSON.stringify({
        type: 'daily',
        createdDateStart: moment(createdTime).format('YYYY-MM-DD'),
        fileType: 'pdf',
      }),
    )

error message: " Error: Download manager failed to download from https:... Status Code = 16 "

@GabrielGomesBarbosa
Copy link

Please provide a complete error log

@konchak007
Copy link
Author

Please provide a complete error log

Error: Download manager failed to download from https.... Status Code = 16

@GabrielGomesBarbosa
Copy link

Probably your application can't reach the URL that you want to get file, check the URL and all headers and params that you are passing.

@RonRadtke
Copy link
Owner

You can download it to file cache and then use the media store API to move it in the downloads, sure.
But that won't resolve issues with the download if these are on server side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants