let localSong = `${RNFS.DocumentDirectoryPath}/${await RNFS.mkdir(`
${RNFS.DocumentDirectoryPath}/${name}`)}/${fileName}`;
I am having this issue i am not able to create directory RNFS.mkdir if anyone have solved so please help me!
It gets fixed if you add
android:requestLegacyExternalStorage="true"
to your manifest in
But i am storing in internal storage
any fix for this?
@azizijunaid
let localSong = `${RNFS.DocumentDirectoryPath}/${await RNFS.mkdir(` ${RNFS.DocumentDirectoryPath}/${name}`)}/${fileName}`;I am having this issue i am not able to create directory RNFS.mkdir if anyone have solved so please help me!
I believe your problem is because RNFS.mkdir returns void
mkdir(filepath: string, options?: MkdirOptions): Promise<void>
I would create the directory separately, then create the path for let localSong
import {
PermissionsAndroid,
} from "react-native";
async function checkAndroidPermission() {
try {
const permission = PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE;
await PermissionsAndroid.request(permission);
Promise.resolve();
} catch (error) {
Promise.reject(error);
}
}
璇锋眰鏉冮檺
Same issue
i solved it by add requestLegacyExternalStorage in AndroidManifest
when i saw if from rn-fetch-blob here
the same issue
Most helpful comment
It gets fixed if you add
This opts you into the legacy storage model, and your existing external storage code will work. It seems that this fix will not work on Android R and higher though, so this is only a short-term fix.
android:requestLegacyExternalStorage="true"
to your manifest in