Hi.
I am using FileZilla ftp server on local work station. I have set FTP site to 127.0.0.1 and pointed virtual root directory to local folder "D:\LocalFtpRepository".
I also created sub folder "D:\LocalFtpRepository\another". I put some files in both folders.
When I try download file from root directory with WinSCP library it the "WriteCommand" pass following command:
get -nopermissions -preservetime -transfer="binary" -- "/Copy88[14].txt" "D:\Data\target\Copy88[14].txt"
and nothing happend.
Ftp protocol is this:
(000155)2/3/2017 10:03:35 AM - (not logged in) (127.0.0.1)> Connected on port 21, sending welcome message...
(000155)2/3/2017 10:03:35 AM - (not logged in) (127.0.0.1)> 220 wassup!
(000155)2/3/2017 10:03:35 AM - (not logged in) (127.0.0.1)> AUTH TLS
(000155)2/3/2017 10:03:35 AM - (not logged in) (127.0.0.1)> 234 Using authentication type TLS
(000155)2/3/2017 10:03:35 AM - (not logged in) (127.0.0.1)> TLS connection established
(000155)2/3/2017 10:03:35 AM - (not logged in) (127.0.0.1)> USER ftpuser
(000155)2/3/2017 10:03:35 AM - (not logged in) (127.0.0.1)> 331 Password required for ftpuser
(000155)2/3/2017 10:03:35 AM - (not logged in) (127.0.0.1)> PASS ********
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> 230 Logged on
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> SYST
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> 215 UNIX emulated by FileZilla
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> FEAT
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> 211-Features:
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> MDTM
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> REST STREAM
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> SIZE
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> MLST type*;size*;modify*;
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> MLSD
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> AUTH SSL
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> AUTH TLS
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> PROT
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> PBSZ
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> UTF8
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> CLNT
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> MFMT
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> EPSV
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> EPRT
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> 211 End
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> CLNT WinSCP-release-5.9.3
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> 200 Don't care
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> OPTS UTF8 ON
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> 202 UTF8 mode is always enabled. No need to send this command.
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> PBSZ 0
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> 200 PBSZ=0
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> PROT P
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> 200 Protection level set to P
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> PWD
(000155)2/3/2017 10:03:35 AM - ftpuser (127.0.0.1)> 257 "/" is current directory.
(000155)2/3/2017 10:03:57 AM - ftpuser (127.0.0.1)> TYPE A
(000155)2/3/2017 10:03:57 AM - ftpuser (127.0.0.1)> 200 Type set to A
(000155)2/3/2017 10:03:57 AM - ftpuser (127.0.0.1)> PASV
(000155)2/3/2017 10:03:57 AM - ftpuser (127.0.0.1)> 227 Entering Passive Mode (127,0,0,1,231,109)
(000155)2/3/2017 10:03:57 AM - ftpuser (127.0.0.1)> MLSD
(000155)2/3/2017 10:03:57 AM - ftpuser (127.0.0.1)> 150 Opening data channel for directory listing of "/"
(000155)2/3/2017 10:03:57 AM - ftpuser (127.0.0.1)> TLS connection for data connection established
(000155)2/3/2017 10:03:57 AM - ftpuser (127.0.0.1)> 226 Successfully transferred "/"
(000155)2/3/2017 10:03:57 AM - ftpuser (127.0.0.1)> disconnected.
When I try to download the very same file fitw FileZilla client the ftp conversation look llike this:
(000151)2/3/2017 9:51:16 AM - (not logged in) (127.0.0.1)> Connected on port 21, sending welcome message...
(000151)2/3/2017 9:51:16 AM - (not logged in) (127.0.0.1)> 220 wassup!
(000151)2/3/2017 9:51:16 AM - (not logged in) (127.0.0.1)> AUTH TLS
(000151)2/3/2017 9:51:16 AM - (not logged in) (127.0.0.1)> 234 Using authentication type TLS
(000151)2/3/2017 9:51:16 AM - (not logged in) (127.0.0.1)> TLS connection established
(000151)2/3/2017 9:51:16 AM - (not logged in) (127.0.0.1)> USER ftpuser
(000151)2/3/2017 9:51:16 AM - (not logged in) (127.0.0.1)> 331 Password required for ftpuser
(000151)2/3/2017 9:51:16 AM - (not logged in) (127.0.0.1)> PASS ********
(000151)2/3/2017 9:51:16 AM - ftpuser (127.0.0.1)> 230 Logged on
(000151)2/3/2017 9:51:16 AM - ftpuser (127.0.0.1)> PBSZ 0
(000151)2/3/2017 9:51:16 AM - ftpuser (127.0.0.1)> 200 PBSZ=0
(000151)2/3/2017 9:51:16 AM - ftpuser (127.0.0.1)> PROT P
(000151)2/3/2017 9:51:16 AM - ftpuser (127.0.0.1)> 200 Protection level set to P
(000151)2/3/2017 9:51:16 AM - ftpuser (127.0.0.1)> CWD /
(000151)2/3/2017 9:51:16 AM - ftpuser (127.0.0.1)> 250 CWD successful. "/" is current directory.
(000151)2/3/2017 9:51:16 AM - ftpuser (127.0.0.1)> PWD
(000151)2/3/2017 9:51:16 AM - ftpuser (127.0.0.1)> 257 "/" is current directory.
(000151)2/3/2017 9:51:16 AM - ftpuser (127.0.0.1)> TYPE A
(000151)2/3/2017 9:51:16 AM - ftpuser (127.0.0.1)> 200 Type set to A
(000151)2/3/2017 9:51:16 AM - ftpuser (127.0.0.1)> PASV
(000151)2/3/2017 9:51:16 AM - ftpuser (127.0.0.1)> 227 Entering Passive Mode (127,0,0,1,195,29)
(000151)2/3/2017 9:51:16 AM - ftpuser (127.0.0.1)> RETR Copy99.txt
(000151)2/3/2017 9:51:16 AM - ftpuser (127.0.0.1)> 150 Opening data channel for file download from server of "/Copy99.txt"
(000151)2/3/2017 9:51:16 AM - ftpuser (127.0.0.1)> TLS connection for data connection established
(000151)2/3/2017 9:51:20 AM - ftpuser (127.0.0.1)> 226 Successfully transferred "/Copy99.txt"
(000151)2/3/2017 9:52:11 AM - ftpuser (127.0.0.1)> disconnected.
Another thing is that when I try download file from subfolder with WinSCP it works:
Command:
get -nopermissions -preservetime -transfer="binary" -- "/another/Copy88.txt" "D:\Data\target\Copy88.txt"
and FTP conersation:
(000156)2/3/2017 10:09:26 AM - (not logged in) (127.0.0.1)> Connected on port 21, sending welcome message...
(000156)2/3/2017 10:09:26 AM - (not logged in) (127.0.0.1)> 220 wassup!
(000156)2/3/2017 10:09:26 AM - (not logged in) (127.0.0.1)> AUTH TLS
(000156)2/3/2017 10:09:26 AM - (not logged in) (127.0.0.1)> 234 Using authentication type TLS
(000156)2/3/2017 10:09:26 AM - (not logged in) (127.0.0.1)> TLS connection established
(000156)2/3/2017 10:09:26 AM - (not logged in) (127.0.0.1)> USER ftpuser
(000156)2/3/2017 10:09:26 AM - (not logged in) (127.0.0.1)> 331 Password required for ftpuser
(000156)2/3/2017 10:09:26 AM - (not logged in) (127.0.0.1)> PASS ********
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> 230 Logged on
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> SYST
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> 215 UNIX emulated by FileZilla
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> FEAT
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> 211-Features:
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> MDTM
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> REST STREAM
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> SIZE
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> MLST type*;size*;modify*;
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> MLSD
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> AUTH SSL
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> AUTH TLS
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> PROT
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> PBSZ
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> UTF8
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> CLNT
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> MFMT
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> EPSV
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> EPRT
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> 211 End
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> CLNT WinSCP-release-5.9.3
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> 200 Don't care
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> OPTS UTF8 ON
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> 202 UTF8 mode is always enabled. No need to send this command.
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> PBSZ 0
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> 200 PBSZ=0
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> PROT P
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> 200 Protection level set to P
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> PWD
(000156)2/3/2017 10:09:26 AM - ftpuser (127.0.0.1)> 257 "/" is current directory.
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> MLST /another/Copy88.txt
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> 250-Listing /another/Copy88.txt
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> type=file;size=147714048;modify=20170127195545; /another/Copy88.txt
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> 250 End
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> CWD /another/
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> 250 CWD successful. "/another" is current directory.
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> PWD
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> 257 "/another" is current directory.
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> TYPE A
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> 200 Type set to A
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> PASV
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> 421 Could not create socket.
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> PORT 127,0,0,1,192,117
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> 200 Port command successful
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> MLSD
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> 150 Opening data channel for directory listing of "/another"
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> TLS connection for data connection established
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> 226 Successfully transferred "/another"
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> TYPE I
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> 200 Type set to I
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> PORT 127,0,0,1,192,118
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> 200 Port command successful
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> RETR Copy88.txt
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> 150 Opening data channel for file download from server of "/another/Copy88.txt"
(000156)2/3/2017 10:09:37 AM - ftpuser (127.0.0.1)> TLS connection for data connection established
(000156)2/3/2017 10:09:40 AM - ftpuser (127.0.0.1)> 226 Successfully transferred "/another/Copy88.txt"
(000156)2/3/2017 10:09:41 AM - ftpuser (127.0.0.1)> disconnected.
and C# code is this:
SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Ftp,
HostName = "127.0.0.1",
UserName = "ftpuser",
Password = "ftplocal",
FtpMode = FtpMode.Passive,
FtpSecure = FtpSecure.Explicit,
GiveUpSecurityAndAcceptAnyTlsHostCertificate = true
};
using (Session session = new Session())
{
// Connect
session.Open(sessionOptions);
//string remotePath = @"/";
//string filename = "Copy88[14].txt";
string remotePath = @"/another/";
string filename = "Copy88.txt";
string localPath = @"D:\Data\target";
session.GetFiles(Path.Combine(remotePath, filename), Path.Combine(localPath, filename)).Check();
}
Any Ideas?[/b]