Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.6k views
in .NET FTP by (240 points)
I use the free version of .net libary. I use the FTPClient to transfer some image and when I set the FTPClient.TransferType = Binary, it still using the ASCII mode to transfer the file which corrupt the file. Is it a bug or the FTPClient not support Binary model?

6 Answers

0 votes
by (162k points)
Binary is supported and is the default. Please enable logging and post the log file. See

http://www.enterprisedt.com/products/ed ... index.html
0 votes
by (240 points)
Binary is supported and is the default. Please enable logging and post the log file. See

http://www.enterprisedt.com/products/ed ... index.html


Please see the below log info:

DEBUG [FTPClient] 17 Mar 2014 14:02:48.667 : Connecting to 0.0.0.0:21
DEBUG [HostNameResolver] 17 Mar 2014 14:02:48.667 : Resolving 0.0.0.0
DEBUG [HostNameResolver] 17 Mar 2014 14:02:48.667 : 0.0.0.0 resolved to 0.0.0.0
INFO [BaseSocket] 17 Mar 2014 14:02:48.667 : Connecting to 0.0.0.0:21 with timeout 120000 ms
DEBUG [BaseSocket] 17 Mar 2014 14:02:48.677 : Successfully connected to 0.0.0.0:21
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:48.677 : Setting socket timeout=120000
INFO [FTPControlSocket] 17 Mar 2014 14:02:48.677 : Command encoding=System.Text.SBCSCodePageEncoding
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:48.677 : StrictReturnCodes=False
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:48.701 : 220 ProFTPD 1.3.5rc1 Server (ProFTPD) [::ffff:0.0.0.0]
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:48.701 : ---> TYPE I
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:48.710 : 200 Type set to I
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:48.710 : ---> USER palladiu
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:48.725 : 331 Password required for palladiu
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:48.725 : ---> PASS ********
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:48.815 : 230 User palladiu logged in
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:48.815 : ---> CWD /sync/sponsor
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:48.854 : 250 CWD command successful
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:48.854 : ---> SIZE beastie-17032014125645.png
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:48.909 : 550 SIZE not allowed in ASCII mode
DEBUG [FTPClient] 17 Mar 2014 14:02:48.909 : SIZE not supported
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:48.909 : ---> MDTM beastie-17032014125645.png
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:48.960 : 550 beastie-17032014125645.png: No such file or directory
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:48.961 : ---> PASV
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:49.017 : 227 Entering Passive Mode (0,0,0,0,235,240).
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:49.017 : Server supplied address=0.0.0.0
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:49.017 : Server supplied port=60400
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:49.017 : autoPassiveIPSubstitution=False
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:49.017 : remoteAddr=0.0.0.0
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:49.017 : NewPassiveDataSocket(0.0.0.0,60400)
INFO [BaseSocket] 17 Mar 2014 14:02:49.017 : Connecting to 0.0.0.0:60400 with timeout 120000 ms
DEBUG [BaseSocket] 17 Mar 2014 14:02:49.069 : Successfully connected to 0.0.0.0:60400
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:49.069 : Connected
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:49.069 : ---> STOR beastie-17032014125645.png
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:49.116 : 150 Opening ASCII mode data connection for beastie-17032014125645.png
DEBUG [FTPClient] 17 Mar 2014 14:02:49.116 : Closing source stream
DEBUG [FTPClient] 17 Mar 2014 14:02:49.116 : Transferred 100241 bytes to remote host
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:49.403 : 226 Transfer complete
DEBUG [FTPFileFactory] 17 Mar 2014 14:02:49.403 : Defaulting to Unix parsing
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:49.403 : ---> QUIT
DEBUG [FTPControlSocket] 17 Mar 2014 14:02:49.452 : 221 Goodbye.
0 votes
by (162k points)
Ok, you'll need to set the transfer type explicitly after connecting, e.g.

ftp.TransferType = TransferType.BINARY


It is only in FTPConnection that it defaults to binary.
0 votes
by (240 points)
Ok, you'll need to set the transfer type explicitly after connecting, e.g.

ftp.TransferType = TransferType.BINARY


It is only in FTPConnection that it defaults to binary.


Thank you for your reply. But I have set the TransferType to BINARY.

Jacky
0 votes
by (162k points)
It looks like you set it prior to logging in. Try setting it after you have logged in.
0 votes
by (240 points)
It looks like you set it prior to logging in. Try setting it after you have logged in.


It Works!!!! Thank you very much for so amazing support speed and responsible. Great product and support

Categories

...