Link to home
Start Free TrialLog in
Avatar of TeKKeD
TeKKeD

asked on

URGENT: FTP CONNECTION PROBLEM !!!

I have a windows service wich transfers files from local network FTP Site, through Local network FilesServer, to a Remote FTP Site (Outside Organisation Network)
I am using an .NET library  with namespace  "EnterpriseDT.Net.Ftp".
I tested service within our organisation network and it works fine, but when I'm trying to upload files remotly (outside our network) it failes.
I Should allso mention that I am able to log in and upload files to remote FTP Site using 3-rd Application Tools and also Command Prompt Window.

This is the code:
After I made a connection and authentication I am using these method to upload files to remote FTp site:


            If ftp Is Nothing Then
                ftp = New FTPClient
            End If
            'If Not ftp.IsConnected Then
            ftp.Timeout = 480 * 1000  ' 480 seconds, LeechFTP default connection timeout
            ftp.StrictReturnCodes = False
            'TODO: Set FTP IP Address
            Dim url As New System.Uri("ftp://111..11.11.11/")  'IP Address
            ftp.RemoteHost = url.Host()
            ftp.Connect()

            'TODO: Set User and Password for FTP Site
            ftp.Login("UserName", "Password")

         
            ftp.Put("C:\FOLDER_NAME\" & FileName, filename)  '****** This is main method for uploading the files********

 This is the exception text:

Task with ID Ftp failed on 5/18/2006 11:41:20 AM with message: 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. Stack trace:
   at EnterpriseDT.Net.Ftp.FTPClient.PutASCII(Stream srcStream, String remoteFile, Boolean append)
   at EnterpriseDT.Net.Ftp.FTPClient.Put(String localPath, String remoteFile, Boolean append)
   at EnterpriseDT.Net.Ftp.FTPClient.Put(String localPath, String remoteFile)
   at Mediamaker.WebScheduler.FtpTask.upload() in C:\PROJEKTIFTP\FTP2\Mediamaker.WebScheduler\FtpTask.vb:line 331
   at Mediamaker.WebScheduler.FtpTask.ExecuteFtp(Uri url, String saveTo, Boolean disconnect, Boolean& failures) in C:\PROJEKTIFTP\FTP2\Mediamaker.WebScheduler\FtpTask.vb:line 162

Please if any one can provide me with any information !!??
Avatar of Melih SARICA
Melih SARICA
Flag of Türkiye image

Remote server timed out .. thats the problem
Avatar of TeKKeD
TeKKeD

ASKER

In midtime I saw some articles on the WEB regarding Windows Errors and my err message :

Socket Error 10060 - Operation Timed Out


******
Error Number 10060:  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.  
This error is quite self explanatory. It means that Windows reported that a connection attempt or idle connection timed out
If this error occurs during a connection attempt (eg in a VPOP3 - SMTP Client connection problem error message), then it means that Windows couldn't connect to the ISP mail server within a fixed time (the timeout limit is fixed within Windows itself). This problem can either mean that your ISP is having a problem, that you are connecting through a slow proxy (You can assign retry parameters on the Utilities -> Misc Settings -> Network Tweaks page), or that your Dial-up connection is faulty.

If this error occurs whilst a connection is in progress (eg in a VPOP3 - POP3 Client Problem error message), then it means that the connection was idle for a set time - this timeout time can be changed on the Utilities -> Misc Settings -> Network Tweaks page.

*******

I tried also to increase timeout, and tried with all other references, but it failed again... : (

Avatar of TeKKeD

ASKER

If there is a remote server timeout (and it is for sure), why it works with 3'rd tools and command prompt, what should I do within my app ??!!
ASKER CERTIFIED SOLUTION
Avatar of Melih SARICA
Melih SARICA
Flag of Türkiye image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TeKKeD

ASKER

I made batch file for FTP Upload wich is called from service and so far it works fine
Thank you non zero
Hold on .. What runs ur code is an Service ?
Somtimes Servcie Applications crash for Service Startup Account.
if ur application  is a Service, and if ur trying to access some local resources( files ) , Servcie Account must ave access to this job, And also.. If application is running under XP SP 2 and Firewall is active u must add ur application to the alowed application list with specified port

Melih SARICA