joltup / rn-fetch-blob

A project committed to making file access and data transfer easier, efficient for React Native developers.
MIT License
2.8k stars 767 forks source link

Unable to locate file on iPad #838

Open waqaramjad opened 1 year ago

waqaramjad commented 1 year ago

Hi I am using the latest version of this package and trying to download a simple pdf file, i can get the path of the downloaded file but that file does not appear in that location:

Platform: IPad

Here is my code: const url = "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"; const dirPath = RNFetchBlob.fs.dirs.DownloadDir; const timestamp = new Date().getTime(); // Get current timestamp const fileName =${timestamp}myfile.pdf; // Add timestamp to file name const filePath =${dirPath}/${fileName}`;

try {
  const response = await RNFetchBlob.config({
    fileCache: true,
    path: filePath,
  }).fetch("GET", url);

  const path = response.path();

`

anjan-daffo88 commented 1 year ago

+1

alexandr-feschenko commented 6 months ago

Hi I am using the latest version of this package and trying to download a simple pdf file, i can get the path of the downloaded file but that file does not appear in that location:

Platform: IPad

Here is my code: const url = "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"; const dirPath = RNFetchBlob.fs.dirs.DownloadDir; const timestamp = new Date().getTime(); // Get current timestamp const fileName =${timestamp}myfile.pdf; // Add timestamp to file name const filePath =${dirPath}/${fileName}`;

try {
  const response = await RNFetchBlob.config({
    fileCache: true,
    path: filePath,
  }).fetch("GET", url);

  const path = response.path();

`

Try RNFetchBlob.fs.dirs.DocumentDir for IOS