MLST used instead of MLSD

Advertisement

james007
Joined:
Posts:
3

MLST used instead of MLSD

Hello,
We are trying to get a file from FTP server (implicit SSL) using .Net

We are using
SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Ftp,
HostName = "xxx.xxx.be",
UserName = "xxxxxx",
Password = "xxxxxx",
PortNumber = 990,
FtpSecure = FtpSecure.Implicit,
SslHostCertificateFingerprint = "54:8d:3c:6b:7f:90:ec:f9:2a:55:43:f4:6b:93:64:c2:be:4b:62:87"
};
using (Session session = new Session())
{
session.Open(sessionOptions);
string path = "/ZTH/Files/Current/437/Update/ZTH.zip";
session.GetFiles(path, System.IO.Path.GetTempPath()).Check();
}

WinSCP is using MLST which is not supported by the server.

. 2013-01-28 15:13:00.644 Listing file "/ZTH/Files/Current/437/Update/ZTH.zip".
. 2013-01-28 15:13:00.644 Retrieving file information...
> 2013-01-28 15:13:00.644 MLST /ZTH/Files/Current/437/Update/ZTH.zip
< 2013-01-28 15:13:00.659 502 Command not implemented.

Using WinSCP GUI, all is fine, MLSD is used.

Any help?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

Re: MLST used instead of MLSD

First, I believe the specifications do not allow the server to support only one of MLST/MLSD pair.

Anyway, I hope you can workaround that by using:
TransferOptions options = new TransferOptions();
options.FileMask = "ZTH.zip";
session.GetFiles("/ZTH/Files/Current/437/Update/", System.IO.Path.GetTempPath(), false, options);

Reply with quote

james007
Joined:
Posts:
3

Re: MLST used instead of MLSD

martin wrote:

First, I believe the specifications do not allow the server to support only one of MLST/MLSD pair.

Anyway, I hope you can workaround that by using:
TransferOptions options = new TransferOptions();
options.FileMask = "ZTH.zip";
session.GetFiles("/ZTH/Files/Current/437/Update/", System.IO.Path.GetTempPath(), false, options);

Hello,

Thanks for your suggestion, but the workaround isn't working. I don't undestand why the .Net assembly version is using MLST while this command is not listed in the FEAT list of the server. When I use the full WinSCP (GUI version), everything is OK, MLSD is used, not MLST...

Here is the full log of the .Net assembly version:

. 2013-01-29 08:22:07.281 --------------------------------------------------------------------------
. 2013-01-29 08:22:07.281 WinSCP Version 5.1.3 (Build 2881) (OS 6.1.7601 Service Pack 1)
. 2013-01-29 08:22:07.281 Configuration: nul
. 2013-01-29 08:22:07.281 Local account: cpu1521-PC\coljo1
. 2013-01-29 08:22:07.281 Working directory: C:\Dev DotNet\trunk\CHRH.Net\CHRH\CHRH\bin\Debug
. 2013-01-29 08:22:07.281 Command-line: "C:\Dev DotNet\trunk\CHRH.Net\CHRH\CHRH\bin\Debug\winscp.exe" /xmllog="C:\Users\coljo1\AppData\Local\Temp\wscp1380.03690209.tmp" /xmlgroups /nointeractiveinput /dotnet=513 /ini=nul /log="C:\winscp.log"  /console /consoleinstance=_4992_464
. 2013-01-29 08:22:07.281 Time zone: Current: GMT+1, Standard: GMT+1, DST: GMT+2, DST Start: 31/03/2013, DST End: 27/10/2013
. 2013-01-29 08:22:07.281 Login time: mardi 29 janvier 2013 08:22:07
. 2013-01-29 08:22:07.281 --------------------------------------------------------------------------
. 2013-01-29 08:22:07.281 Session name: user@ftp.xxx.com (Ad-Hoc session)
. 2013-01-29 08:22:07.281 Host name: ftp.xxx.com (Port: 990)
. 2013-01-29 08:22:07.281 User name: user (Password: Yes, Key file: No)
. 2013-01-29 08:22:07.281 Tunnel: No
. 2013-01-29 08:22:07.281 Transfer Protocol: FTP
. 2013-01-29 08:22:07.281 Ping type: C, Ping interval: 30 sec; Timeout: 15 sec
. 2013-01-29 08:22:07.281 Proxy: none
. 2013-01-29 08:22:07.281 FTP: FTPS: Implicit SSL/TLS; Passive: Yes [Force IP: A]
. 2013-01-29 08:22:07.281 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2013-01-29 08:22:07.281 Cache directory changes: Yes, Permanent: Yes
. 2013-01-29 08:22:07.281 DST mode: 1
. 2013-01-29 08:22:07.281 --------------------------------------------------------------------------
. 2013-01-29 08:22:07.571 Connecting to ftp.xxx.com:990 ...
. 2013-01-29 08:22:07.591 Connected with ftp.xxx.com:990, negotiating SSL connection...
. 2013-01-29 08:22:07.902 SSL connection established. Waiting for welcome message...
< 2013-01-29 08:22:08.120 220 Wing FTP Server ready...
> 2013-01-29 08:22:08.121 USER user
< 2013-01-29 08:22:08.134 331 Password required for user
> 2013-01-29 08:22:08.135 PASS ********
< 2013-01-29 08:22:08.155 230 User user logged in.
> 2013-01-29 08:22:08.155 SYST
< 2013-01-29 08:22:08.168 215 UNIX Type: L8
> 2013-01-29 08:22:08.168 FEAT
< 2013-01-29 08:22:08.182 211-Extension supported
< 2013-01-29 08:22:08.186  PBSZ
< 2013-01-29 08:22:08.187  PROT
< 2013-01-29 08:22:08.187  MDTM
< 2013-01-29 08:22:08.187  MDTM YYYYMMDDHHMMSS;filename
< 2013-01-29 08:22:08.187  MFMT
< 2013-01-29 08:22:08.187  MFCT
< 2013-01-29 08:22:08.187  MFF Create;Modify;
< 2013-01-29 08:22:08.187  SIZE
< 2013-01-29 08:22:08.187  MLSD
< 2013-01-29 08:22:08.187  CLNT
< 2013-01-29 08:22:08.187  UTF8
< 2013-01-29 08:22:08.187  AUTH SSL
< 2013-01-29 08:22:08.187  AUTH TLS
< 2013-01-29 08:22:08.187  OPTS
< 2013-01-29 08:22:08.187  STAT
< 2013-01-29 08:22:08.187  EPRT
< 2013-01-29 08:22:08.187  HELP
< 2013-01-29 08:22:08.187  XCRC "filename" SP EP
< 2013-01-29 08:22:08.201  SITE HELP
< 2013-01-29 08:22:08.201  SITE MSG messagetext
< 2013-01-29 08:22:08.201  SITE PSWD oldpass newpass
< 2013-01-29 08:22:08.201  SITE UZIP filename.zip
< 2013-01-29 08:22:08.201  SITE ZIP filename.zip sourcefile1||sourcefile2||sourcefile3||...
< 2013-01-29 08:22:08.201 211 End
> 2013-01-29 08:22:08.201 CLNT FileZilla
< 2013-01-29 08:22:08.215 200 Noted.
> 2013-01-29 08:22:08.215 OPTS UTF8 ON
< 2013-01-29 08:22:08.230 200 OPTS UTF8 ON
> 2013-01-29 08:22:08.230 PBSZ 0
< 2013-01-29 08:22:08.246 200 Command okay. PBSZ=0.
> 2013-01-29 08:22:08.246 PROT P
< 2013-01-29 08:22:08.261 200 Encrypting Data Channel.
. 2013-01-29 08:22:08.261 Connected
. 2013-01-29 08:22:08.261 --------------------------------------------------------------------------
. 2013-01-29 08:22:08.261 Using FTP protocol.
. 2013-01-29 08:22:08.261 Doing startup conversation with host.
> 2013-01-29 08:22:08.261 PWD
< 2013-01-29 08:22:08.275 257 "/" is current directory.
. 2013-01-29 08:22:08.275 Getting current directory name.
. 2013-01-29 08:22:08.275 Startup conversation with host finished.
< 2013-01-29 08:22:08.275 Script: Active session: [1] user@ftp.xxx.com
> 2013-01-29 08:22:09.244 Script: get  -nopermissions -preservetime -transfer="binary" -filemask="ZTH.zip" -- "/ZTH/Files/Current/437/Update/" "C:\Users\coljo1\AppData\Local\Temp\"
. 2013-01-29 08:22:09.244 Listing file "/ZTH/Files/Current/437/Update/".
. 2013-01-29 08:22:09.244 Retrieving file information...
> 2013-01-29 08:22:09.244 MLST //ZTH/Files/Current/437/Update/
< 2013-01-29 08:22:09.258 502 Command not implemented.
. 2013-01-29 08:22:09.258 Could not retrieve file information
< 2013-01-29 08:22:09.259 Script: Can't get attributes of file '/ZTH/Files/Current/437/Update/'.
< 2013-01-29 08:22:09.259 Script: Could not retrieve file information

< 2013-01-29 08:22:09.259 Command not implemented.
. 2013-01-29 08:22:09.259 Script: Failed
> 2013-01-29 08:22:09.389 Script: exit
. 2013-01-29 08:22:09.390 Script: Exit code: 1
. 2013-01-29 08:22:09.391 Disconnected from server

Reply with quote

james007
Joined:
Posts:
3

Re: MLST used instead of MLSD

martin wrote:

First, I believe the specifications do not allow the server to support only one of MLST/MLSD pair.

Anyway, I hope you can workaround that by using:
TransferOptions options = new TransferOptions();
options.FileMask = "ZTH.zip";
session.GetFiles("/ZTH/Files/Current/437/Update/", System.IO.Path.GetTempPath(), false, options);

It is working when adding * at the end of the remote path... Thanks.

Reply with quote

Advertisement

You can post new topics in this forum