Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access Denied #1237

Open
nehalasim opened this issue Jul 1, 2024 · 0 comments
Open

Access Denied #1237

nehalasim opened this issue Jul 1, 2024 · 0 comments

Comments

@nehalasim
Copy link

I have all permission. But still shows error.
Possible Unhandled Promise Rejection (id: 2):
Error: ENOENT: /storage/emulated/0/Download/DataBackup/prf.db: open failed: EACCES (Permission denied), open '/storage/emulated/0/Download/DataBackup/prf.db'

THIS IS MY CODE.

const onShare=()=>{

const full_path = RNFS.DownloadDirectoryPath + "/DataBackup/prf.db";
RNFS.exists(full_path)
.then((exist)=>{
  if(exist){
      RNFS.moveFile(full_path, RNFS.DownloadDirectoryPath+"/prf_new.db");
      console.log("exist"+RNFS.DownloadDirectoryPath);
      console.log(RNFS.DownloadDirectoryPath);
    
  }else{

    console.log("not exist");

  }
}).catch((error)=>{
  console.log(error);
})

}

N.B: when I run the create folder function, the is created successfully in Downlaod folder.
RNFS.exists(RNFS.DownloadDirectoryPath + "/DataBackup")
.then(exists => {
if (!exists) {
RNFS.mkdir(RNFS.DownloadDirectoryPath + "/DataBackup")
}}).catch(error => {
console.error("Error checking MEMBER directory existence:", error);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant