0 votes
by (460 points)
edited

Hi,

i downloaded a trail version 3.1.0.0.

and i implemented one test application.with Upload and Download functionalities.

Upload functionality is working fine but while downloading i am getting error like

--------------------------------------------------------------------------------
10:35:16.734 Info Info: Connecting to ******** using Ftp 4.0.4444.0 (trial version).
10:35:16.734 Info Info: Using proxy none.
10:35:17.406 Info Response: 220 Welcome to ******** Secure FTP Server.
10:35:17.421 Info Command: USER ********
10:35:17.718 Info Response: 331 User name okay, need password.
10:35:17.734 Info Command: PASS ********
10:35:18.031 Info Response: 230 User logged in, proceed.
10:35:18.046 Info Command: FEAT
10:35:18.343 Info Response: 211-Extension supported
10:35:18.828 Info Response:  AUTH TLS
10:35:18.828 Info Response:  SSCN
10:35:18.828 Info Response:  PBSZ
10:35:18.828 Info Response:  PROT
10:35:18.828 Info Response:  CCC
10:35:18.828 Info Response:  CLNT
10:35:18.843 Info Response:  MDTM
10:35:18.843 Info Response:  MDTM YYYYMMDDHHMMSS[+-TZ];filename
10:35:18.843 Info Response:  SIZE
10:35:18.843 Info Response:  SITE PSWD;EXEC;SET;INDEX;ZONE;CHMOD;MSG
10:35:18.843 Info Response:  REST STREAM
10:35:18.843 Info Response:  XCRC filename;start;end
10:35:18.843 Info Response:  MODE Z
10:35:18.843 Info Response:  MLST Type*;Size*;Create;Modify*;Win32.ea*;
10:35:18.843 Info Response: 211 End
10:35:18.859 Info Command: SYST
10:35:19.156 Info Response: 215 UNIX Type: L8
10:35:19.156 Info Command: PWD
10:35:19.468 Info Response: 257 "/g:/test" is current directory.
10:35:19.468 Info Command: MLST INBOX
10:35:19.781 Info Response: 250-Listing /g:/test
10:35:20.250 Info Response:  Type=dir;Modify=20120402041751;Win32.ea=0x00000010; INBOX
10:35:20.250 Info Response: 250 End.
10:35:20.250 Info Command: CWD /g:/test/INBOX
10:35:20.562 Info Response: 250 Directory changed to /g:/test/INBOX
10:35:20.562 Info Command: PWD
10:35:20.859 Info Response: 257 "/g:/test/INBOX" is current directory.
10:35:20.906 Info Command: MLST /g:/test/INBOX
10:35:21.218 Info Response: 250-Listing /g:/test
10:35:21.671 Info Response:  Type=dir;Modify=20120402041751;Win32.ea=0x00000010; INBOX
10:35:21.671 Info Response: 250 End.
10:35:21.718 Info Command: TYPE A
10:35:22.015 Info Response: 200 Type set to A.
10:35:22.031 Info Command: PASV
10:35:22.328 Info Response: 227 Entering Passive Mode (209,240,160,82,4,117)
10:35:22.671 Info Command: MLSD /g:/test/INBOX
10:35:22.968 Info Response: 150 Opening BINARY mode data connection for MLSD.
10:35:23.421 Info Response: 226 Transfer complete.
10:35:23.421 Info Command: PASV
10:35:23.734 Info Response: 227 Entering Passive Mode (209,240,160,82,4,118)
10:35:24.046 Info Command: MLSD /g:/test/INBOX/INBOX
10:35:24.343 Info Response: 501 /g:/test/INBOX/INBOX: Not a directory.
10:35:24.421 Error Info: Rebex.Net.FtpBatchTransferException: Error when retrieving items from a remote directory ('/g:/test/INBOX/INBOX'). /g:/test/INBOX/INBOX: Not a directory (501). ---> Rebex.Net.FtpException: /g:/test/INBOX/INBOX: Not a directory (501).
   at Rebex.Net.Ftp.2aYAeNZ(String , Boolean , OTxlj , Int64 , String , String , Int64 , FtpTransferState )
   at Rebex.Net.Ftp.zo0DuZ(String , Boolean , Stream , Int64 , String , 27NpLhZ )
   at Rebex.Net.Ftp.1rcNck(String , 27NpLhZ )
   at gbMKS.2DV1RXZ.ProcessRemoteDirectory(1YiDCIZ traversalInfo, Boolean addNewInfos)
   --- End of inner exception stack trace ---
   at 1RyBHn.1yALZOZ.HandleException(Exception ex, 2CkSFs type, 1Acxa2 remoteItem, 1Acxa2 localItem, 1vhEpGZ defaultAction, 1vhEpGZ possibleActions, 1vhEpGZ& chosenAction)
   at 1RyBHn.1yALZOZ.HandleCaughtException(Exception caught, String message, 2CkSFs type, String remotePath, String localPath, 1Acxa2 remoteItem, 1Acxa2 localItem, 1vhEpGZ possibleActions, 1vhEpGZ& chosenAction)
   at 1RyBHn.1yALZOZ.cIZv0(1YiDCIZ )
   at 1RyBHn.1yALZOZ.N30HDZ()
   at 1RyBHn.1yALZOZ.Transfer(YpcDbZ method, 18waHwZ sourceFilter, String targetPath, TransferMethod transferMethod, MoveMode moveMode, LinkProcessingMode actionOnLinks, ActionOnExistingFiles actionOnExistingFiles, 1Acxa2 expectedRootItem)
   at gbMKS.2DV1RXZ.1jMzU7Z(28xx7VZ , p5IYsZ , String , TransferMethod , MoveMode , LinkProcessingMode , ActionOnExistingFiles )
   at Rebex.Net.Ftp.VGSfy(p5IYsZ , String , TransferMethod , MoveMode , LinkProcessingMode , ActionOnExistingFiles )
--------------------------------------------------------------------------------

and my code for Download is:

ftp.Connect(strFtpIp, iFtpPort); ftp.Login(strFtpUsrname, strFtpPwd);

            string strFtpCurrentDir = string.Empty;
            bool blFtpDirExists;

            strFtpCurrentDir = ftp.GetCurrentDirectory();
            blFtpDirExists = ftp.DirectoryExists(strFtpDownloadDir);

            if (blFtpDirExists == true)
            {
                ftp.ChangeDirectory(strFtpCurrentDir + "/" + strFtpDownloadDir);
                strFtpCurrentDir = ftp.GetCurrentDirectory();

                DirectoryInfo localDir = new DirectoryInfo(strLocalDir);
                if (!localDir.Exists)
                {
                    localDir.Create();
                }
                ftp.GetFiles(strFtpCurrentDir, localDir.ToString(), FtpBatchTransferOptions.Recursive, FtpActionOnExistingFiles.OverwriteAll);

                ftp.Disconnect();

What mistake in my code. help me to resolve this issue

Thanks in adnace Srinu

Applies to: Rebex SFTP

4 Answers

0 votes
by (147k points)
edited

It looks like there might be something wrong with MLST/MLSD commands, either at the server side or client side (Rebex FTP/SSL).

Does it work if you add the following line to your code? (Just below ftp.Connect call)

ftp.EnabledExtensions &= ~FtpExtensions.MachineProcessingList;

If it does, please mail the log it produces to us to make it possible to fix the issue. Thanks!

0 votes
by (460 points)
edited

Hi Lukas,

Thanks for your quick repaly.

By adding that line of code its worked. and the log for your reference is:

---------------------------------------------------------------
14:54:59.296 Info Info: Connecting to ***** using Ftp 4.0.4444.0 (trial version).
14:54:59.296 Info Info: Using proxy none.
14:54:59.953 Info Response: 220 Welcome to ***** Secure FTP Server.
14:54:59.968 Info Command: USER *****
14:55:00.265 Info Response: 331 User name okay, need password.
14:55:00.281 Info Command: PASS *****
14:55:00.593 Info Response: 230 User logged in, proceed.
14:55:00.593 Info Command: FEAT
14:55:00.906 Info Response: 211-Extension supported
14:55:01.218 Info Response:  AUTH TLS
14:55:01.218 Info Response:  SSCN
14:55:01.218 Info Response:  PBSZ
14:55:01.218 Info Response:  PROT
14:55:01.218 Info Response:  CCC
14:55:01.234 Info Response:  CLNT
14:55:01.234 Info Response:  MDTM
14:55:01.234 Info Response:  MDTM YYYYMMDDHHMMSS[+-TZ];filename
14:55:01.234 Info Response:  SIZE
14:55:01.234 Info Response:  SITE PSWD;EXEC;SET;INDEX;ZONE;CHMOD;MSG
14:55:01.234 Info Response:  REST STREAM
14:55:01.234 Info Response:  XCRC filename;start;end
14:55:01.234 Info Response:  MODE Z
14:55:01.234 Info Response:  MLST Type*;Size*;Create;Modify*;Win32.ea*;
14:55:01.234 Info Response: 211 End
14:55:01.250 Info Command: SYST
14:55:01.562 Info Response: 215 UNIX Type: L8
14:55:01.562 Info Command: PWD
14:55:01.875 Info Response: 257 "/g:/TEST" is current directory.
14:55:01.875 Info Command: TYPE I
14:55:02.187 Info Response: 200 Type set to I.
14:55:02.187 Info Command: SIZE .
14:55:02.484 Info Response: 550 /g:/TEST: No such file.
14:55:02.484 Info Command: MDTM .
14:55:02.796 Info Response: 213 20120403091656
14:55:02.796 Info Command: MDTM TEST
14:55:03.093 Info Response: 213 20120403091614
14:55:03.093 Info Command: SIZE TEST
14:55:03.406 Info Response: 550 /g:/TEST/TEST: No such file.
14:55:03.406 Info Command: CWD /g:/TEST/TEST
14:55:03.718 Info Response: 250 Directory changed to /g:/TEST/TEST
14:55:03.718 Info Command: PWD
14:55:04.078 Info Response: 257 "/g:/TEST/TEST" is current directory.
14:55:04.125 Info Command: MDTM /g:/TEST/TEST
14:55:04.421 Info Response: 213 20120403091614
14:55:04.437 Info Command: SIZE /g:/TEST/TEST
14:55:04.781 Info Response: 550 /g:/TEST/TEST: No such file.
14:55:04.828 Info Command: TYPE A
14:55:05.140 Info Response: 200 Type set to A.
14:55:05.140 Info Command: PASV
14:55:05.453 Info Response: 227 Entering Passive Mode (209,240,160,82,4,93)
14:55:05.781 Info Command: LIST /g:/TEST/TEST
14:55:06.078 Info Response: 150 Opening ASCII mode data connection for /bin/ls.
14:55:06.625 Info Response: 226 Transfer complete.
14:55:06.656 Info Command: TYPE I
14:55:06.968 Info Response: 200 Type set to I.
14:55:06.968 Info Command: SIZE /g:/TEST/TEST/ssssss (1).tif
14:55:07.265 Info Response: 213 26308
14:55:07.265 Info Command: PASV
14:55:07.578 Info Response: 227 Entering Passive Mode (209,240,160,82,4,94)
14:55:07.906 Info Command: RETR /g:/TEST/TEST/ssssss (1).tif
14:55:08.203 Info Response: 150 Opening BINARY mode data connection for ssssss (1).tif (26308 Bytes).
14:55:09.453 Info Response: 226 Transfer complete.
14:55:09.453 Info Command: SIZE /g:/TEST/TEST/ssssss (2).tif
14:55:09.765 Info Response: 213 20716
14:55:09.765 Info Command: PASV
14:55:10.093 Info Response: 227 Entering Passive Mode (209,240,160,82,4,95)
14:55:10.453 Info Command: RETR /g:/TEST/TEST/ssssss (2).tif
14:55:10.750 Info Response: 150 Opening BINARY mode data connection for ssssss (2).tif (20716 Bytes).
14:55:11.843 Info Response: 226 Transfer complete.
14:55:11.859 Info Command: SIZE /g:/TEST/TEST/ssssss (3).tif
14:55:12.156 Info Response: 213 51344
14:55:12.171 Info Command: PASV
14:55:12.468 Info Response: 227 Entering Passive Mode (209,240,160,82,4,98)
14:55:12.796 Info Command: RETR /g:/TEST/TEST/ssssss (3).tif
14:55:13.093 Info Response: 150 Opening BINARY mode data connection for ssssss (3).tif (51344 Bytes).
14:55:14.859 Info Response: 226 Transfer complete.
14:55:14.875 Info Command: SIZE /g:/TEST/TEST/ssssss (4).tif
14:55:15.171 Info Response: 213 54788
14:55:15.171 Info Command: PASV
14:55:15.484 Info Response: 227 Entering Passive Mode (209,240,160,82,4,99)
14:55:15.796 Info Command: RETR /g:/TEST/TEST/ssssss (4).tif
14:55:16.093 Info Response: 150 Opening BINARY mode data connection for ssssss (4).tif (54788 Bytes).
14:55:18.156 Info Response: 226 Transfer complete.
14:55:18.171 Info Command: SIZE /g:/TEST/TEST/ssssss.tif
14:55:18.468 Info Response: 213 38160
14:55:18.468 Info Command: PASV
14:55:18.828 Info Response: 227 Entering Passive Mode (209,240,160,82,4,102)
14:55:19.140 Info Command: RETR /g:/TEST/TEST/ssssss.tif
14:55:19.437 Info Response: 150 Opening BINARY mode data connection for ssssss.tif (38160 Bytes).
14:55:21.000 Info Response: 226 Transfer complete.
14:55:21.015 Info Command: QUIT
14:55:21.328 Info Response: 221 Goodbye!

---------------------------------------------------------------

Actually our company wnats to buy it when you people fix this issue?

Thanks & Regards Srinu

0 votes
by (460 points)
edited

Hi Lukas,

While transferring the files through ftp i am showing file progress in progress bar in UI.

Until i place the code given by you, download and progress bar or working parallelly

but now my UI screen freezes until all the files downloaded form ftp.

12:38:31.453 Info Info: Connecting to ******* using Ftp 4.0.4444.0 (trial version).
12:38:31.468 Info Info: Using proxy none.
12:38:32.531 Info Response: 220 Welcome to WorldTech Secure FTP Server.
12:38:32.546 Info Command: USER *******
12:38:33.031 Info Response: 331 User name okay, need password.
12:38:33.031 Info Command: PASS *******
12:38:33.406 Info Response: 230 User logged in, proceed.
12:38:33.421 Info Command: FEAT
12:38:33.796 Info Response: 211-Extension supported
12:38:34.437 Info Response:  AUTH TLS
12:38:34.437 Info Response:  SSCN
12:38:34.437 Info Response:  PBSZ
12:38:34.437 Info Response:  PROT
12:38:34.437 Info Response:  CCC
12:38:34.437 Info Response:  CLNT
12:38:34.437 Info Response:  MDTM
12:38:34.437 Info Response:  MDTM YYYYMMDDHHMMSS[+-TZ];filename
12:38:34.437 Info Response:  SIZE
12:38:34.453 Info Response:  SITE PSWD;EXEC;SET;INDEX;ZONE;CHMOD;MSG
12:38:34.453 Info Response:  REST STREAM
12:38:34.453 Info Response:  XCRC filename;start;end
12:38:34.453 Info Response:  MODE Z
12:38:34.453 Info Response:  MLST Type*;Size*;Create;Modify*;Win32.ea*;
12:38:34.453 Info Response: 211 End
12:38:34.453 Info Command: SYST
12:38:34.937 Info Response: 215 UNIX Type: L8
12:38:34.953 Info Command: PWD
12:38:35.328 Info Response: 257 "/g:/mranywhere" is current directory.
12:38:35.328 Info Command: TYPE I
12:38:35.671 Info Response: 200 Type set to I.
12:38:35.671 Info Command: SIZE .
12:38:36.156 Info Response: 550 /g:/mranywhere: No such file.
12:38:36.156 Info Command: MDTM .
12:38:36.640 Info Response: 213 20120404064605
12:38:36.640 Info Command: MDTM BACKUP
12:38:37.140 Info Response: 213 20120404063732
12:38:37.140 Info Command: SIZE BACKUP
12:38:37.640 Info Response: 550 /g:/mranywhere/BACKUP: No such file.
12:38:37.640 Info Command: CWD /g:/mranywhere/BACKUP
12:38:38.125 Info Response: 250 Directory changed to /g:/mranywhere/BACKUP
12:38:38.125 Info Command: PWD
12:38:38.515 Info Response: 257 "/g:/mranywhere/BACKUP" is current directory.
12:38:38.562 Info Command: MDTM /g:/mranywhere/BACKUP
12:38:38.937 Info Response: 213 20120404063732
12:38:38.937 Info Command: SIZE /g:/mranywhere/BACKUP
12:38:39.281 Info Response: 550 /g:/mranywhere/BACKUP: No such file.
12:38:39.312 Info Command: TYPE A
12:38:39.812 Info Response: 200 Type set to A.
12:38:39.812 Info Command: PASV
12:38:40.296 Info Response: 227 Entering Passive Mode (209,240,160,82,4,115)
12:38:40.796 Info Command: LIST /g:/mranywhere/BACKUP
12:38:41.281 Info Response: 150 Opening ASCII mode data connection for /bin/ls.
12:38:41.828 Info Response: 226 Transfer complete.
12:38:41.859 Info Command: TYPE I
12:38:42.343 Info Response: 200 Type set to I.
12:38:42.343 Info Command: SIZE /g:/mranywhere/BACKUP/rrrrrrr (1).tif
12:38:42.718 Info Response: 213 26308
12:38:42.718 Info Command: PASV
12:38:43.093 Info Response: 227 Entering Passive Mode (209,240,160,82,4,116)
12:38:43.453 Info Command: RETR /g:/mranywhere/BACKUP/rrrrrrr (1).tif
12:38:43.937 Info Response: 150 Opening BINARY mode data connection for rrrrrrr (1).tif (26308 Bytes).
12:38:45.921 Info Response: 226 Transfer complete.
12:38:45.968 Info Command: SIZE /g:/mranywhere/BACKUP/rrrrrrr (2).tif
12:38:46.390 Info Response: 213 20716
12:38:46.390 Info Command: PASV
12:38:46.890 Info Response: 227 Entering Passive Mode (209,240,160,82,4,119)
12:38:47.406 Info Command: RETR /g:/mranywhere/BACKUP/rrrrrrr (2).tif
12:38:47.906 Info Response: 150 Opening BINARY mode data connection for rrrrrrr (2).tif (20716 Bytes).
12:38:49.578 Info Response: 226 Transfer complete.
12:38:49.609 Info Command: SIZE /g:/mranywhere/BACKUP/rrrrrrr (3).tif
12:38:50.093 Info Response: 213 51344
12:38:50.093 Info Command: PASV
12:38:50.562 Info Response: 227 Entering Passive Mode (209,240,160,82,4,123)
12:38:51.093 Info Command: RETR /g:/mranywhere/BACKUP/rrrrrrr (3).tif
12:38:51.578 Info Response: 150 Opening BINARY mode data connection for rrrrrrr (3).tif (51344 Bytes).
12:38:54.156 Info Response: 226 Transfer complete.
12:38:54.187 Info Command: SIZE /g:/mranywhere/BACKUP/rrrrrrr (4).tif
12:38:54.671 Info Response: 213 54788
12:38:54.671 Info Command: PASV
12:38:55.156 Info Response: 227 Entering Passive Mode (209,240,160,82,4,125)
12:38:55.656 Info Command: RETR /g:/mranywhere/BACKUP/rrrrrrr (4).tif
12:38:56.031 Info Response: 150 Opening BINARY mode data connection for rrrrrrr (4).tif (54788 Bytes).
12:39:00.406 Info Response: 226 Transfer complete.
12:39:00.437 Info Command: SIZE /g:/mranywhere/BACKUP/rrrrrrr.tif
12:39:00.937 Info Response: 213 38160
12:39:00.937 Info Command: PASV
12:39:01.437 Info Response: 227 Entering Passive Mode (209,240,160,82,4,80)
12:39:01.843 Info Command: RETR /g:/mranywhere/BACKUP/rrrrrrr.tif
12:39:02.171 Info Response: 150 Opening BINARY mode data connection for rrrrrrr.tif (38160 Bytes).
12:39:04.093 Info Response: 226 Transfer complete.
12:39:04.125 Info Command: QUIT
12:39:04.609 Info Response: 221 Goodbye!

Please help me to resolve to this Issue.

Thanks & Regards Srinu

0 votes
by (147k points)
edited

Please try transferring the files using the FtpWinFormClient sample that comes with Rebex FTP/SSL install package – does the UI freeze there as well? (You might need to add _ftp.EnabledExtensions &= ~FtpExtensions.MachineProcessingList to the sample code first to make it work for you.)

Looking at your code, however, it looks like the synchronous GetFiles method call might be responsible for the UI freezing. To solve this, either change your code to use asynchronous methods such as BeginGetFiles/EndGetFiles (proper but complicated solution), or register a TransferProgress event handler and call an Application.DoEvents() method from it (ugly and potentially problematic hack, but often very efficient).

...