crifurch / pure_ftp

MIT License
6 stars 3 forks source link

Unhandled Exception: FtpException: restSize more than file size. fileSize:-1, restSize:0 #16

Closed abdelaziz-mahdy closed 1 month ago

abdelaziz-mahdy commented 1 month ago

when i try to download files i get this error

  Future<void> _downloadFile(FtpFile file) async {
    Directory? downloadsDirectory = await getDownloadsDirectory();
    List<int> result =
        await ftpConnect!.fs.downloadFile(file, onReceiveProgress: (_, __, p) {
      print("downloaded: $p");
    });

  }
flutter: [2024-05-16 11:42:53.238135] 192.168.1.5:15114> SIZE /Download/Anime_here/One Piece/One Piece ep 968 1920x1080.ts.mkv
flutter: [2024-05-16 11:42:53.541526] 192.168.1.5:15114< 550 No directory traversal allowed in SIZE param
flutter: [2024-05-16 11:42:53.542197] 192.168.1.5:15114> PASV
flutter: [2024-05-16 11:42:53.844910] 192.168.1.5:15114< 227 Entering Passive Mode (192,168,1,5,151,235).
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: FtpException: restSize more than file size. fileSize:-1, restSize:0
#0      FtpTransfer.downloadFileStream.<anonymous closure>.<anonymous closure> (package:pure_ftp/src/file_system/ftp_transfer.dart:34:17)
#1      FtpSocket._openTransferChannelPassive (package:pure_ftp/src/ftp/ftp_socket.dart:240:29)
<asynchronous suspension>
#2      FtpTransfer.downloadFileStream.<anonymous closure> (package:pure_ftp/src/file_system/ftp_transfer.dart:31:11)
<asynchronous suspension>