I'm trying to download audio file "mp3" using rn-fetch-blob
.
So I have more than one cases :)
When I trying to add a path to RNFetchBlob config like this
const pathFile = RNFetchBlob.fs.dirs.MainBundleDir // Or .DocumentDir // Others is crashed my App 'Android';
The callback "then" get success so it's Log
The file is saved to /data/user/0/com.music/files/RNFetchBlobTmp_1ueoigyb8hoscuuizzsue.mp3
But when I try to explore this file in my real device I can't find them I don't know why!
So there's one faced same issue like this in Android?
startDownload = () => {
const {url} = this.state;
const pathFile = RNFetchBlob.fs.dirs.DocumentDir;
let date = new Date();
RNFetchBlob.config({
fileCache: true,
path:
pathFile +
'/me_' +
Math.floor(date.getTime() + date.getSeconds() / 2),
})
.fetch('GET', url)
.then(res => {
console.log('The file is save to ', res.path()); // It's log here but i can't see the file :\
})
.catch(err => console.log('err', err));
};