Hello,
I want to Create Directory using the Capacitor FileSystem api. Earlier using cordova File plugin i was able to create the directory on my mobile device with this code and i was able to see the folder in my file manager.
this.file.createDir(this.file.externalRootDirectory, 'TestFolder', true).then(() => {
alert('Directory Created Successfully');
}, (err) => {
alert('Error While Creating Directory');
});
Now in capacitor i am trying to create a folder like this
async WriteFileInExternalStorage() {
try {
let ret = await Plugins.Filesystem.writeFile({
path: 'TestFile.txt',
data: "This is a test",
directory: FilesystemDirectory.ExternalStorage,
encoding: FilesystemEncoding.UTF8
});
alert('Directory Created Successfully');
} catch (e) {
alert('Error While Creating Directory');
}
}
Even though it showing Directory has been created successfully, but i am unable to see the folder in my device(I don’t have SD card in my device,i want to save it to the internal storage)
Can somebody please help me to create a directory in my device using capacitors filesystem api so that i can see the folder in my device file manager.