uploadKml method

dynamic uploadKml(
  1. File inputFile,
  2. String filename
)

Connects to the current client through SFTP, uploads a file into it and then disconnects. uploading kml file

Implementation

uploadKml(File inputFile, String filename) async {
  final sftp = await _client?.sftp();
  // ignore: unused_local_variable
  double anyKindofProgressBar;
  final file = await sftp?.open('/var/www/html/$filename',
      mode: SftpFileOpenMode.create |
          SftpFileOpenMode.truncate |
          SftpFileOpenMode.write);
  var fileSize = await inputFile.length();
  await file?.write(inputFile.openRead().cast(), onProgress: (progress) {
    anyKindofProgressBar = progress / fileSize;
  });
}