Error: Download manager failed to download from <url> Status Code = 16 React Native:"rn-fetch-blob"

103 views Asked by At

Trying to download file from backed (React Native) I need to do POST request with header (token) File don't download.

const response = await RNFetchBlob.config({
    fileCache: true,
    appendExt: 'pdf', 
    path: fs.dirs.DownloadDir + '/file.pdf', 
    addAndroidDownloads: {
      useDownloadManager: true,
      notification: true,
      path: fs.dirs.DownloadDir + '/file.pdf',
      description: 'File downloaded by download manager.',
    },
  }).fetch(
    'POST',
    `${url}`,
    {
      'access-token': token,
      'Content-Type': 'application/pdf',
      'content-disposition': 'attachment; filename="document.pdf',
    },
    bodyString,
  )
0

There are 0 answers