Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file.resolveLocalFilesystemUrl is not a function #378

Closed
Sunny41 opened this issue Feb 27, 2020 · 1 comment
Closed

file.resolveLocalFilesystemUrl is not a function #378

Sunny41 opened this issue Feb 27, 2020 · 1 comment

Comments

@Sunny41
Copy link

Sunny41 commented Feb 27, 2020

  • [x ] Support Question

Hi,
I am having an issue with the File plugin in working with ionic.
The error is:
ERROR TypeError: this.file.resolveLocalFilesystemUrl is not a function
plugin Version is 6.0.2 and it's present when I run cordova plugin ls

My code looks like this:

download(num: number) {
    const d = new Date();
    const n = d.getTime();
    const newFileName = n + '.jpg';

    const externalStoragePath: string = this.file.dataDirectory;
    console.log(externalStoragePath);
    // externalStoragePath is always undefined...


    this.file.resolveLocalFilesystemUrl('file:///' + this.slides[num]).then((entry: any) => {
      this.file.resolveLocalFilesystemUrl(externalStoragePath).then((dirEntry: any) => {
        entry.copy(dirEntry, newFileName);
      }).catch((error) => {
        console.log('dirEntryerror: ' + error);
      });
    });
  }

What I already tried:

  • looking in the plugin code itself, the function is there;
  • remove and reinstall the plugin
  • when I type in the beginning of the function, my IDE suggests it and there is no Error, also in compiling...

I hope you can help me :)

@timbru31
Copy link
Member

If you use Ionic's Native wrapper, please seek support via their channels - otherwise use cordova.file as stated in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants