1

I'm trying to download a file using react-native-fs.

The file downloads but I can't see it in the Files app on the device.

Here is the code:

const RNFS = require('react-native-fs');
const directory = RNFS.DocumentDirectoryPath;
const filePath = `${directory}/${fileName}`;

RNFS.downloadFile({
    fromUrl: fileURL,
    toFile: filePath,
}).promise.then((res) => {
    console.log(res);
});

There is an answer here but it works up to iOS 14 and my project is for iOS 15.

Any help would be appreciated!

0 Answers0