Closed abdelaziz-mahdy closed 4 months ago
tested using another ftp server, that the message gets sent after finishing the copying
it works correctly there.
oh, i'm found problem
i will try fix it in few moments
@abdelaziz-mahdy try this https://github.com/crifurch/pure_ftp/tree/fix/dowload_wait_response_error, i tested on large file? i think it is not necessary to wait some response after download
now it should works as expected
the flush is needed, i will test again, since the files gets downloaded but corrupted
pls try test in now, remove pubspec.lock before pub get
btw flutter upgrade should get the updated without the need to delete the lock, but will try it
and don't forget change to binary transfer if you are download some not text filles
changing to binary fixed the corrupted problem, should that be the default? most of the ftp downloads are not text files if i am correct
client.socket.setTransferType(FtpTransferType.binary);
in auto mode i had
Downloaded 24467980 of 24468684 bytes
Downloaded 24469428 of 24469428 bytes
if i used
await client.socket.setTransferType(FtpTransferType.binary);
i had only
Downloaded 24468304 of 24468684 bytes
Downloaded 24468684 of 24468684 bytes
Disconnecting from 192.168.1.200:21
changing to binary fixed the corrupted problem, should that be the default? most of the ftp downloads are not text files if i am correct
client.socket.setTransferType(FtpTransferType.binary);
i think yes but in many cases ftp clients use auto mode as default
you can use
FtpClient(
socketInitOptions: FtpSocketInitOptions(
host: config['host'],
port: config['port'],
transferType: FtpTransferType.binary,
),
authOptions: FtpAuthOptions(
username: config['username'],
password: config['password'],
account: config['account'],
),
logCallback: print,
);
okay thank you very much, the download completes using the mentioned branch
ok, i will update package now
i think the download function is waiting for a command
but if that command is
226 Transmission finished
it got sent, but looks like it got sent before the file could finish copyinganyway to know what is the problem?