Thans for the reply Lukas
I am using Rebex FTP component to download files from FTP server. My requirement is as follows
I have multiple folders in my root directory on the FTP server and each folder has sub folders and hundreds of files. To download the files I wrote the following code:
Public Sub DownloadCallFiles()
Try
Dim client As New Ftp
client.LogWriter = New Rebex.FileLogWriter("c:\ftp\log.txt", Rebex.LogLevel.Debug)
client.Connect(ConfigurationManager.AppSettings("Host"), 21)
client.Login(ConfigurationManager.AppSettings("Username"),ConfigurationManager.AppSettings("Password"))
client.GetFiles("/*", "c:\FTP\Test", FtpBatchTransferOptions.Recursive, FtpActionOnExistingFiles.OverwriteDifferentSize)
Catch ex As Exception
DownloadCallFiles()
Finally
End Try
End Sub
The problem I am facing is after downloading couple of folders and few hundred files (which is taking about 5-6 minutes) it’s getting disconnected by throwing the following exception
"A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond."
What I have done is I am calling the same subroutine in my catch block and that way I am able to download all the folders and files.
My second question is before downloading the file can I check some filters. i.e. check the remote file with the local file. I have to check two things, say the remote file name is test.csv
1) Check if the remote file has been downloaded then do not download again
After downloading the file we import the local files into database and add a extension to it say test.tkn so I have to check the same file twice
For example : If Test.csv exist on local folder or test.tkn exist on local folder then do not download
Do you have any example to accomplish such type of task.
Regards
Ritesh