Open sai13mogli opened 3 years ago
I have an issue. I am downloading a video file that is downloading to all other folders for example Downloads, Music, but through an error.
unsupported path /storage/emulated/0/VideoDownloader/TikTok/TIKTOKVIDEO .
` const normaldownload = dispatch => async (url, foldername , name_prefix) =>{
let mydirs = RNFetchBlob.fs.dirs.SDCardDir
var date = new Date()
let checkdir = await RNFetchBlob.fs.isDir(`${mydirs}/VideoDownloader/${foldername}`);
if(!checkdir){
RNFetchBlob.fs.mkdir(`${mydirs}/VideoDownloader/${foldername}`).then((res) =>{
console.log('created', res)
}).catch((error) =>{
console.log('Error', error)
})
}else{
console.log("Dir existss")
}
try{
let options = {
fileCache: true,
addAndroidDownloads : {
useDownloadManager :true, // setting it to true will use the device's native download manager and will be shown in the notification bar.
notification : true,
mime : 'video/mp4',
description : 'Downloading Video',
path: mydirs+`/VideoDownloader/${foldername}/${name_prefix}`+Math.floor(date.getTime() + date.getSeconds() / 2) + '.mp4', // this is the path where your downloaded file will live in
}
}
PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE,{
title: "Storage",
message: "This app would like to store some files on your phone"
}).then( async () => {
RNFetchBlob.config(options).fetch('GET', url).then((res) => {
console.log('path of the downloads ')
ToastAndroid.showWithGravityAndOffset(
`File Saved in VideoDownloader/${foldername}😃 `,
ToastAndroid.LONG,
ToastAndroid.BOTTOM,
25,
50
)
}).catch((error) =>{
console.log(error,'ERRRROR')
ToastAndroid.showWithGravityAndOffset(
`Download Failed`,
ToastAndroid.LONG,
ToastAndroid.BOTTOM,
25,
50
);
})
})
}
catch(error){
console.log("Error in catch " , error)
}
}
`
The above code WOrking fine on android 9 ad less but it through Error on android 10.
I have already added this line.
android:requestLegacyExternalStorage="true"
Still no improvement.
Android 10 not accept old paths is depreceated. Use picture or movies folders from system.
Just encounter this too.... is there a fix to it
Hi ! Thank you for reporting an issue, but we would like to remind you, we have a trouble shooting page in our wiki. You may want to take a look on that page or find issues tagged "trouble shooting" :p