Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 28460

EISDIR: illegal operation on a directory, read in React Native file system

$
0
0

I'm trying simple code to copy a file to another external folder using this code:

RNFS.copyFile(sourcePath, destinationPath)
.then(result => {
  console.log('file copied:', result);
})
.catch(err => {
  console.log('error: ', err.message, err.code);
});

and i have already granted Android.Permission for read and write in external directory but it's still returning this error:

error:  EISDIR: illegal operation on a directory, read '/storage/emulated/0/' EISDIR

here are the dependency:

"react": "16.9.0",
"react-native": "0.61.2",
"react-native-fs": "^2.15.2"

BTW Am i request correct permission ?

PermissionsAndroid.PERMISSIONS.READ_EXTERNAL_STORAGE 
PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE

Thanks for help in advance


Viewing all articles
Browse latest Browse all 28460

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>