Error: Permission denied
See original GitHub issueHI, I am working on react-native new version, I have implement the html converter to pdf and got the base64 data. I have tried to download file in my Download folder. I am try download using this library but get the Permission denied error. I am add a android permissions, WRITE_EXTERNAL_STORAGE and <action android:name="android.intent.action.DOWNLOAD_COMPLETE"/>
But got the this error:
Error: Permission denied
at Object.fn [as writeFile] (index.bundle?platfor…&minify=false:10730)
at Object.writeFile (index.bundle?platfor…minify=false:334448)
Code:
createAndSavePDF = async() => {
let options = {
html: '<h1>This is a test PDF</h1>',
fileName: 'test',
directory: 'Download',
base64: true
};
let file = await RNHTMLtoPDF.convert(options)
// RNFetchBlob.fs.dirs.DownloadDir it's getting the download folder from internal storage
let filePath = RNFetchBlob.fs.dirs.DownloadDir + '/testPDF.pdf';
RNFetchBlob.fs.writeFile(filePath, file.base64, 'base64')
.then(response => {
console.log('Success Log: ', response);
})
.catch(errors => {
console.log(" Error Log: ", errors);
})
}
I am working on debug mode on system.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
How to resolve the "Permission Denied" error in Linux
While using Linux, you may encounter the error, “permission denied”. This error occurs when the user does not have the privileges to make...
Read more >How to fix 'permission denied' error in Linux? [Solutions]
This type of error will occur whenever you run a command for which you do not have the execute permission. Similarly, you cannot...
Read more >How to Fix Shell Script Permission Denied Error in Linux
To fix the permission denied error in Linux, one needs to change the file permission of the script. Use the “chmod” (change mode)...
Read more >How to solve the bash: permission denied error?
The permission denied error is encountered when the script you are running does not have the execute permission. Unix and similar operating systems...
Read more >Troubleshoot "Permission denied (Publickey)" or ...
You're trying to connect using the wrong user name for your AMI. · The file permissions within the operating system are incorrect on...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
On Android 10, you should to ask permissions through PermissionsAndroid
Try something like:
Got the same problem in Android 10 when trying to copy a file with cp to Downloads directory.
in AndroidManifesl.xml seems to help. Don’t know if it is the issue with the library.