Nexific / dart_ftpclient

FTP Client Library for Dart Native
https://pub.dev/packages/ftpclient
MIT License
17 stars 5 forks source link

List directory not working #9

Open yashaswi2000 opened 4 years ago

yashaswi2000 commented 4 years ago

I am trying to get the list of directories and files in FTP server and getting below error in flutter Unhandled Exception: FTPException: Can't get content of directory. (Response: 500 Command not understood.)

virtualmarc commented 4 years ago

It seems like your FTP Server does not understand the MLST Command to list files.

Please enable the debug Flag (FTPClient constructor) and attach the log (remove any sensitive information from the log).

What FTP Server Software do you use?

yashaswi2000 commented 4 years ago

It seems to be working after I replace MLSD with LIST command

yashaswi2000 commented 4 years ago

my server is windows iis

virtualmarc commented 4 years ago

LIST normally responds with a human readable version, while MLST/MLSD respond with a machine readable response, so this is not a general solution.

yashaswi2000 commented 4 years ago

ohh ok i will attach the log

yashaswi2000 commented 4 years ago

I/flutter (13572): [26.03.2020 12:42:48.518] Connecting... I/flutter (13572): [26.03.2020 12:42:48.553] < 220 Microsoft FTP Service I/flutter (13572): [26.03.2020 12:42:48.554] > USER pbns I/flutter (13572): [26.03.2020 12:42:48.661] < 331 Password required I/flutter (13572): [26.03.2020 12:42:48.662] > PASS ndms@123 I/flutter (13572): [26.03.2020 12:42:48.767] < 230 User logged in. I/flutter (13572): [26.03.2020 12:42:48.768] Connected! I/flutter (13572): [26.03.2020 12:42:48.775] > PWD I/flutter (13572): [26.03.2020 12:42:48.879] < 257 "/" is current directory. I/flutter (13572): / I/flutter (13572): [26.03.2020 12:42:48.895] > TYPE A I/flutter (13572): [26.03.2020 12:42:48.998] < 200 Type set to A. I/flutter (13572): [26.03.2020 12:42:48.999] > PASV I/flutter (13572): [26.03.2020 12:42:49.102] < 227 Entering Passive Mode (183,82,120,238,200,219). I/flutter (13572): [26.03.2020 12:42:49.107] > MLST I/flutter (13572): [26.03.2020 12:42:49.122] < 500 Command not understood. E/flutter (13572): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: FTPException: Can't get content of directory. (Response: 500 Command not understood.)

virtualmarc commented 4 years ago

Thanks!

I will investigate this further.

ghost commented 4 years ago

Hi! I'm have the same problem. Is there any temporary solution?

yashaswi2000 commented 4 years ago

well I had the problem because the windows servers don't support MLST/ MLSD commands so I used LIST command it only gives strings as output, not machine-readable output.

ghost commented 4 years ago

Thanks for the tip! But I don't know very much about List Command. So, can you explain me or indicate any tutorial?

Again... Thanks for the help!

yashaswi2000 commented 4 years ago

This link is what helped me understand the command, it also has documentation for other FTP commands also, hope it will be helpful.

ghost commented 4 years ago

Thanks!

yegor-pelykh commented 4 years ago

I have the same problem. LIST command is working too.

Could you please implement support for LIST command aslo instead of MLSD?

rovannlinhalis commented 4 years ago

any way to allow folders and files to contain semicolons in their names?

rocboronat commented 3 years ago

Hello! 👋 The same happens with vsftpd. I'm going to move to ProFTPd and that's it, as the README suggests, but... just for the info 😄

rocboronat commented 3 years ago

Hi again! Just installed a ProFTPd server, and it doesn't' work either. Same error 😢

techilla commented 3 years ago

I also had problems with the directory listings. In my case I had to switch transfer mode from ascii to binary in listDirectoryContent(). But error was "425 Can't open data connection."