Uncaught promise with ionic-native/ftp


#1

Hello,

I want to connect my application on a personal server to upload and download file. I see that i can do that with the ionic-native/ftb cordova plugin.

I have this error when i try to implement it :
Error: Uncaught (in promise): Error: No provider for FTP!
injectionError@http://192.168.1.56:8100/build/main.js:1739:86
noProviderError@http://192.168.1.56:8100/build/main.js:1777:12

My ftp.service.ts is :

import { Injectable } from '@angular/core';

import * as firebase from 'firebase/app'
import { FTP } from '@ionic-native/ftp';

@Injectable()
export class FtpService {

  constructor( private fTP: FTP ) {
  }

  connect(hostname: string, username: string, password: string): firebase.Promise<any> {
    return this.fTP.connect(hostname, username, password);
  }

  upload(localFile: string, remoteFile: string): firebase.Promise<any> {
    return this.fTP.upload(localFile, remoteFile);
  }

  download(localFile: string, remoteFile: string): firebase.Promise<any> {
    return this.fTP.download(localFile, remoteFile);
  }

  disconnect(): void {
    this.fTP.disconnect();
  }
}

I have not forgotten to add it in providers in app.module.ts and when i juste add “public ftpService: FtpService” in a Ionic Page even without using the functions of it, I have the error.

Thanks a lot if you have the answer :slight_smile: