我正在尝试使用rn-fetch-blob
.
所以我有不止一个案例:)
当我尝试像这样添加 RNFetchBlob 配置的路径时
const pathFile = RNFetchBlob.fs.dirs.MainBundleDir // Or .DocumentDir // Others is crashed my App 'Android';
回调“then”成功,所以它是 Log
The file is saved to /data/user/0/com.music/files/RNFetchBlobTmp_1ueoigyb8hoscuuizzsue.mp3
但是当我尝试在我的真实设备中探索这个文件时,我找不到它们,我不知道为什么!
那么在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));
};