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

MLSD command #3

Closed
BBBits opened this issue Jun 28, 2020 · 8 comments
Closed

MLSD command #3

BBBits opened this issue Jun 28, 2020 · 8 comments

Comments

@BBBits
Copy link

BBBits commented Jun 28, 2020

Hi , just gave the example a test run.
couldn't drag'n drop a file into chrome , so connected with winscp
upload was fine at about 380kb/s
when I refreshed the DIR in winscp it was empty.
reloaded the ftp in chrome and the file listed ok.
added some folders with winscp but they show up as files in winscp .
winscp doesn't show the folder name "New Folder" perhaps because of the white space ?
here is some of the console.
28/06/20 18:29:06.741 Ftp server waiting for connection on port 21
28/06/20 18:29:06.747 Client connected!
28/06/20 18:29:06.801 USER esp32
28/06/20 18:29:06.856 PASS esp32
28/06/20 18:29:06.856 OK. Waiting for commands.
28/06/20 18:29:06.912 SYST
28/06/20 18:29:06.965 PWD
28/06/20 18:29:07.018 TYPE I
28/06/20 18:29:07.072 SIZE /
28/06/20 18:29:07.196 CWD /
28/06/20 18:29:07.253 PASV
28/06/20 18:29:07.253 Connection management set to passive
28/06/20 18:29:07.261 Data port set to 50009
28/06/20 18:29:07.316 LIST -l
28/06/20 18:29:07.324 ftpdataserver client....
28/06/20 18:29:07.324 File Name = babynames-gendered-2015.db
28/06/20 18:29:07.332 File Name = census2000names.db
28/06/20 18:29:07.332 File Name = mdr512.db
28/06/20 18:29:07.332 File Name = Data
28/06/20 18:29:07.373 QUIT
28/06/20 18:29:07.373 Disconnecting client
28/06/20 18:29:07.381 Ftp server waiting for connection on port 21
28/06/20 19:00:36.509 Client connected!
28/06/20 19:00:36.619 USER esp32
28/06/20 19:00:36.666 PASS esp32
28/06/20 19:00:36.666 OK. Waiting for commands.
28/06/20 19:00:36.822 SYST
28/06/20 19:00:36.916 FEAT
28/06/20 19:00:37.043 PWD
28/06/20 19:00:37.122 CWD /
28/06/20 19:00:37.231 PWD
28/06/20 19:00:37.325 TYPE A
28/06/20 19:00:37.434 PASV
28/06/20 19:00:37.434 Connection management set to passive
28/06/20 19:00:37.450 Data port set to 50009
28/06/20 19:00:37.543 MLSD
28/06/20 19:00:37.559 ftpdataserver client....
28/06/20 19:00:51.153 TYPE A
28/06/20 19:00:51.200 PASV
28/06/20 19:00:51.200 Connection management set to passive
28/06/20 19:00:51.216 Data port set to 50009
28/06/20 19:00:51.357 RETR Data
28/06/20 19:00:51.388 ftpdataserver client....
28/06/20 19:00:51.388 Sending Data
28/06/20 19:01:21.570 TYPE A
28/06/20 19:01:51.585 REST 0
28/06/20 19:02:21.476 PWD
28/06/20 19:02:51.477 TYPE I
28/06/20 19:02:51.618 TYPE A
28/06/20 19:02:51.665 PASV
28/06/20 19:02:51.665 Connection management set to passive
28/06/20 19:02:51.680 Data port set to 50009
28/06/20 19:02:51.727 MLSD
28/06/20 19:02:51.743 ftpdataserver client....
28/06/20 19:03:21.483 TYPE A
28/06/20 19:03:51.476 REST 0
28/06/20 19:04:21.493 TYPE I
28/06/20 19:04:51.492 TYPE A
28/06/20 19:04:52.214 TYPE A
28/06/20 19:04:52.261 PASV
28/06/20 19:04:52.261 Connection management set to passive
28/06/20 19:04:52.276 Data port set to 50009
28/06/20 19:04:52.417 MLSD
28/06/20 19:04:52.448 ftpdataserver client....
28/06/20 19:05:22.526 TYPE I
28/06/20 19:05:52.530 REST 0
28/06/20 19:06:22.524 TYPE I
28/06/20 19:06:52.537 TYPE I
28/06/20 19:06:52.749 TYPE A
28/06/20 19:06:52.800 PASV
28/06/20 19:06:52.800 Connection management set to passive
28/06/20 19:06:52.810 Data port set to 50009
28/06/20 19:06:52.850 MLSD
28/06/20 19:06:52.857 ftpdataserver client....
28/06/20 19:07:22.542 TYPE A
28/06/20 19:07:52.545 TYPE I
28/06/20 19:08:22.551 TYPE I
28/06/20 19:08:52.558 TYPE A
28/06/20 19:08:53.368 TYPE A
28/06/20 19:08:53.477 PASV
28/06/20 19:08:53.477 Connection management set to passive
28/06/20 19:08:53.493 Data port set to 50009
28/06/20 19:08:53.524 MLSD
28/06/20 19:08:53.539 ftpdataserver client....
28/06/20 19:08:53.649 CWD /
28/06/20 19:08:53.711 MKD New folder
28/06/20 19:08:53.852 TYPE A
28/06/20 19:08:53.914 PASV
28/06/20 19:08:53.914 Connection management set to passive
28/06/20 19:08:53.930 Data port set to 50009
28/06/20 19:08:53.989 MLSD
28/06/20 19:08:53.989 ftpdataserver client....
28/06/20 19:09:10.976 CWD /
28/06/20 19:09:11.085 MKD TestFolder
28/06/20 19:09:11.226 TYPE A
28/06/20 19:09:11.398 PASV
28/06/20 19:09:11.398 Connection management set to passive
28/06/20 19:09:11.398 Data port set to 50009
28/06/20 19:09:11.445 MLSD
28/06/20 19:09:11.445 ftpdataserver client....
28/06/20 19:09:41.501 REST 0
28/06/20 19:10:11.602 REST 0
28/06/20 19:10:41.533 REST 0
28/06/20 19:11:11.514 PWD
28/06/20 19:11:11.913 TYPE A
28/06/20 19:11:12.038 PASV
28/06/20 19:11:12.038 Connection management set to passive
28/06/20 19:11:12.054 Data port set to 50009
28/06/20 19:11:12.117 MLSD
28/06/20 19:11:12.132 ftpdataserver client....
28/06/20 19:11:42.547 TYPE I

WINSCP View (MLSD)
winscp_MLSD

Chrome View (LIST)
chrome_LIST

Might get an opportunity to debug this so will keep ya posted.
Regards
Barry

@fa1ke5
Copy link
Owner

fa1ke5 commented Jun 28, 2020

Hi Barry, as i know browser ftp client functionality dont support write on ftp by drag and drop function. Browsers ftp client is readonly.

@fa1ke5
Copy link
Owner

fa1ke5 commented Jun 28, 2020

if you create folder in ftp cliet server create folder on sd too, you can see mkdir instruction in this code:
if( SD_MMC.mkdir( path )){
client.println( "257 "" + String(parameters) + "" created");
}
for stable work in wincsp try setup connection parameters "passive mode" e.t.c

@fa1ke5
Copy link
Owner

fa1ke5 commented Jun 28, 2020

or try totalcomander ftp client....

@BBBits
Copy link
Author

BBBits commented Jun 29, 2020

Hi,
the problem is actually with the response format of the MLSD command.
perhaps you haven't experienced the problem because your clients only use the LIST command
the correct response was actually commented out so I changed it and all is ok now.
// data.println(fn);
data.println( "Type=dir;Size=" + fs + ";"+"modify=20000101000000;" +" " + fn);
} else {
// data.println( fs + " " + fn);
data.println( "Type=file;Size=" + fs + ";"+"modify=20000101160656;" +" " + fn);

Winscp now displays correct dir structure
winscp_MLSD_Correct

@jruizcoll
Copy link

Thanks BBBits for pointing this issue. Your solution worked for me on OLIMEX ESP32-PoE and SD card, using FileZilla FTP client Passive mode

@jajito
Copy link

jajito commented Dec 6, 2022

Same problem here.
Now it's solved.
Thanks!
It was driving me crazy!

@bhupiister
Copy link

bhupiister commented Mar 15, 2023

Hi, the problem is actually with the response format of the MLSD command. perhaps you haven't experienced the problem because your clients only use the LIST command the correct response was actually commented out so I changed it and all is ok now. **
// data.println(fn);
data.println( "Type=dir;Size=" + fs + ";"+"modify=20000101000000;" +" " + fn);
} else
{
// data.println( fs + " " + fn);
data.println( "Type=file;Size=" + fs + ";"+"modify=20000101160656;" +" " + fn);**

Winscp now displays correct dir structure ![winscp_MLSD_Correct](https://user-

I had to figure this out myself, i wish i had seen your comment before and saved few hours.
By the way it still shows as below and the very reason why FileZilla is not able to list the files and directory.

data.println(fn);
data.println( fs + " " + fn);

Who so ever is watching this comment, uncomment below lines

data.println( "Type=dir;Size=" + fs + ";"+"modify=20000101000000;" +" " + fn); 
data.println( "Type=file;Size=" + fs + ";"+"modify=20000101160656;" +" " + fn);**

At last, thankyou to everyone who made efforts to make and maintain this library.

fa1ke5 added a commit that referenced this issue Mar 15, 2023
changes with this article
#3 (comment)
@fa1ke5
Copy link
Owner

fa1ke5 commented Mar 15, 2023

Внес изменения в мастер ветку, теперь используются
data.println( "Type=dir;Size=" + fs + ";"+"modify=20000101000000;" +" " + fn);
data.println( "Type=file;Size=" + fs + ";"+"modify=20000101160656;" +" " + fn);**
Проблему закрываю, спасибо всем участникам за их помощь

@fa1ke5 fa1ke5 closed this as completed Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants