Maheshvy edited a comment on issue #426:
URL: 
https://github.com/apache/cordova-plugin-file/issues/426#issuecomment-981405951


   #please let me know I'm also facing same issue for android 11 device 
(Cordova android@10 ).
   code :
   
   window.resolveLocalFileSystemURL(cordova.file.externalRootDirectory, 
function(dir) {
       dir.getFile("test.pdf", {create:true}, function(file) {
           file.createWriter(function(fileWriter) {
           fileWriter.write("byteArrays data");
               alert('Message', 'File Downloaded Successfully');
           }, function(){
               alert('Error!', "Unable to save the file");
           });
       },function(e){
           alert('Error!', e);
       });
   },function(e){
       console.log(e);
   });
   
   **I tried with below code in Androidmainfest file**
   
   <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
   <uses-permission android:name="android.permission.ACTION_MANAGE_STORAGE" />
   <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
   
   **Config.xml file**
   <preference name="AndroidInsecureFileModeEnabled" value="true" />
   <preference name="AndroidPersistentFileLocation" value="Compatibility" />
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to