How to create a custom downlod directory


I want to create a custom root directory like whats app when user download the file from my app on that time create a new folder of my app name how can i do that?

below my code:


this.platform.ready().then(() => {

      const fileTransfer: FileTransferObject = this.transfer.create();
      let getUrl = item._meta_gallery_images
      let downloadFileName = getUrl.substr(getUrl.lastIndexOf('/') + 1); 
      //const imageLocation = `${cordova.file.applicationDirectory}www/assets/img/${item}`;
      const url =   getUrl;
      var URL = encodeURI(url);, this.storageDirectory + downloadFileName).then((entry) => {

        const alertSuccess = this.alertCtrl.create({
          title: `Download Succeeded!`,
          subTitle: `${downloadFileName} was successfully downloaded to: ${entry.toURL()}`,
          buttons: ['Ok']


      }, (error) => {

        const alertFailure = this.alertCtrl.create({
          title: `Download Failed!`,
          subTitle: `${downloadFileName} was not successfully downloaded. Error code: ${error.code}`,
          buttons: ['Ok']





Please help me anyone.