Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List directory not working #9

Open
yashaswi2000 opened this issue Mar 26, 2020 · 17 comments
Open

List directory not working #9

yashaswi2000 opened this issue Mar 26, 2020 · 17 comments
Labels
bug Something isn't working

Comments

@yashaswi2000
Copy link

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 virtualmarc added the question Further information is requested label Mar 26, 2020
@virtualmarc
Copy link
Contributor

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
Copy link
Author

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

@yashaswi2000
Copy link
Author

my server is windows iis

@virtualmarc
Copy link
Contributor

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
Copy link
Author

ohh ok i will attach the log

@yashaswi2000
Copy link
Author

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
Copy link
Contributor

Thanks!

I will investigate this further.

@virtualmarc virtualmarc added bug Something isn't working and removed question Further information is requested labels Mar 26, 2020
@ghost
Copy link

ghost commented Apr 21, 2020

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

@yashaswi2000
Copy link
Author

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
Copy link

ghost commented Apr 21, 2020

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
Copy link
Author

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

@ghost
Copy link

ghost commented Apr 21, 2020

Thanks!

@yegor-pelykh
Copy link

yegor-pelykh commented Jun 22, 2020

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

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

@rovannlinhalis
Copy link

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

@rocboronat
Copy link

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
Copy link

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

@techilla
Copy link

techilla commented Oct 17, 2020

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."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants