Create new directory folder/subfolder ionic/vuejs

Hello to all,
i am unable to create a subfolder inside a folder in one step, can you help me understand? This is how it works

import { File } from '@ionic-native/file';

File.createDir(File.externalRootDirectory,'folder', true);

I would like to do something like that, but it doesn’t work

    import { File } from '@ionic-native/file';

    File.createDir(File.externalRootDirectory,'folder/subfolder', true);

sorry my english and thanks for the help

Hi,could you please help me? I’ve been going crazy for many days, but unfortunately I can’t find the solution :frowning:
A thousand thanks

How about trying File system of Capacitor?

Would you have an example to take a cue? Have patience, but I’m new to programming.
I’m using ionic-vue-javascript, all the examples I find are about react and angular

Ok ok finally I got there

import { Filesystem,Directory  } from '@capacitor/filesystem';

  data() {
    return {
     directory : Directory.Documents,     

   createFolder() {   
     path: 'folder/subfolder/2subfolder', recursive: true,

Thanks very much for the advice

1 Like