Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48977

I can't copy files using Filesystem on android 11

$
0
0

Hi, I’m having a big problem now, I can’t copy files to Memory (specifically default documents folder on android), when I do copy I get the following error:

This is my code:

return Filesystem.copy({
          from: `${this.fileSource.path}${this.fileSource.name}`, // This is directory of file from User when imported
          to: `/.QHDDAIT/${this.fileName}`, // This is Folder that I want to copy file
          toDirectory: FilesystemDirectory.Documents,
        })
          .then((_res) => {
            console.log("---> Copy file to Device is successful: ", _res);
            this.setMyFile(this.fileName);
          })
          .catch((error) =>
            console.log("--> Error while copy file to device...", error)
          );

My application is using Vue + Ionic, Capacitor v2, and using Filesystem plugins to handle it, but the above problem only occurs on Android 11 (TargetSDK is 30), android lower version is fine. The above function is related to storing the User’s file in the folder where the app was originally set up, to help users if they accidentally delete their original file, they will have a copy as soon as they have imported the file. into the application.

I have given full Read & Write permission to the App but only some files like (JPG, JPEG, PNG, or some other files) are fine, and the files I want to use are not working (. mbtiles, .geojson, .shp, .dxf, .dgn,…)

Please help me to solve the above problem, thank you very much.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48977

Trending Articles



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