Welcome to the Xceed Community | Help
Community Search  
More Search Options

FTP I/O error when trying to send file

Sort Posts: Previous Next
  •  03-15-2007, 4:29 PM Post no. 5188

    FTP I/O error when trying to send file

    Hi there,

    I'm using the Xceed.ftp .Net component to send a file to a remote ftp server.
    This is an intranet applications, so the connection to the ftp server does not have to be secure.

    This is how my code looks like:

    ftp = new Xceed.Ftp.FtpClient();
    ftp.Connect("server.ftp.com", 21);
    ftp.Login("username", "password");

    fs = new FileStream("C:\local.zip", FileMode.Open, FileAccess.Read, FileShare.Read);
    ftp.SendFile(fs, "Upload_33.zip");

    I managed to logged in just fine and get connected to the ftp server, but every time it hit the point when it's trying to send the file - it will paused and then throw this error:


    "An I/O error occurred while accepting the FTP server's data connection.

    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 Error executing task IOOC Export.FTP upload zip file.
    "

    I checked the ftp server and there's a file named "Upload_33.zip" with size = 0 bytes... I guess somehow this ftp connection is dropped ?
    can anybody help?
  •  03-15-2007, 4:33 PM Post no. 5189 in reply to 5188

    Re: FTP I/O error when trying to send file

    One extra note:
    If connect to the FTP server manually and upload a file manually - everything works solid
  •  03-29-2007, 2:51 PM Post no. 5190 in reply to 5189

    Re: FTP I/O error when trying to send file

    With the other ftp client, do you also specify the port on which you connect?

    Can you set the TraceWriter property so we can get a log of the communication with the server?

    FtpClient.TraceWriter = new StreamWriter( @"D:\ftp.log", true );

    The problem is that the Command channel is open fine, and the commands are sent correctly to the server, but the Data channel (on which the data of the file is sent) connection is not establish. It is hard to say at this point what is the source of the problem.
    André
    Software Developer
    Xceed Software Inc.
  •  04-30-2007, 3:13 PM Post no. 5191 in reply to 5190

    Re: FTP I/O error when trying to send file

    I am receiving the same error. We are using an ssl/ftp connection with the authentication method set to Tls, and the port is set to 990.

    if I set the timeout to a long value, then after about 11 minutes I get the IO error. if I set it to more around 1 minute then I just get a timeout error.

    Here is the output from the log file. Any help would be appreciated.

    Connected to 66.181.11.90:990 on 4/30/2007 @ 1:07:18 PM
    < 220
    > USER aviacode
    < 331 Password required
    > PASS *****
    < 230-user logged in
    < Welcome to Imaging Service's Transcription FTP Server
    < Please do not use this for anything other than what it was intended
    < 230 user logged in
    > TYPE I
    < 200 Type set to IMAGE.
    > PASV
    < 227 Entering Passive Mode (66,181,11,82,4,0).
    > STOR TestFile.zip
    Data connection established with 66.181.11.82:1024 on 4/30/2007 @ 1:07:20 PM
    < 150 Opening BINARY data connection for TestFile.zip
  •  05-01-2007, 4:29 PM Post no. 5192 in reply to 5191

    Re: FTP I/O error when trying to send file

    Is there a firewall/proxy between your client and the server?
    André
    Software Developer
    Xceed Software Inc.
  •  05-01-2007, 4:44 PM Post no. 5193 in reply to 5192

    Re: FTP I/O error when trying to send file

    yes, but ports 21, 990, and 1024 are all open. why does the data connection connect over a different port than 990?
  •  05-02-2007, 2:50 PM Post no. 5194 in reply to 5193

    Re: FTP I/O error when trying to send file

    It is normal that the data channel be connected to a different port. Port 21 or 990 normally serve for the command channel connection. This is how is built the FTP protocol, there are two sockets that need to be open, one for the data channel and the other for the command channel, and they cannot be opened on the same port.

    In passive mode, as you are, it is the server that decides which port to use for the data channel. If your firewall does not allow connection on this port, then the connection will not work, of course. You can try to connect in non passive mode. This way, it is the client that will determine on which port to make the data channel connection, and you can open the corresponding port in the firewall. You can set the port through the LocalDataAddress property on FtpClient.

    André
    Software Developer
    Xceed Software Inc.
  •  05-04-2007, 2:18 AM Post no. 5195 in reply to 5194

    Re: FTP I/O error when trying to send file

    this is getting kind of annoying. I can connect to the ftp server just fine using any client i care to try. Using FireFTP, with the settings on Passive Mode, Implicit SSL (instead of Auth TLS or Auth SSL) and set to port 990, it connects like a charm.

    but no matter what I try I can't get xceed zip to connect to the ftp server and send up a file.
  •  05-04-2007, 11:54 AM Post no. 5196 in reply to 5195

    Re: FTP I/O error when trying to send file

    Do you have the log of the communication with the server from one of the other client you are using, so we can compare what is different from our library? Do you connect implicitly with our library?
    André
    Software Developer
    Xceed Software Inc.
  •  05-05-2007, 10:13 PM Post no. 5197 in reply to 5196

    Re: FTP I/O error when trying to send file

    Here is the log with FireFTP


    220
    PBSZ 0
    200 PBSZ=0
    USER aviacode
    331 Password required
    PASS (password not shown)
    230-user logged in
    Welcome to Imaging Service's Transcription FTP Server
    Please do not use this for anything other than what it was intended
    230 user logged in
    FEAT
    211-Extensions supported
    SIZE
    XCRC
    XMD5
    XSHA1
    XSHA256
    XSHA512
    XSIGN
    MDTM
    MLST
    size*;type*;perm*;create*;modify*;
    LANG EN*;SP
    REST STREAM
    TVFS
    UTF8
    AUTH SSL;TLS-P;
    PBSZ
    PROT C;P;
    211 end
    PWD
    257 "/aviacode" is current directory
    TYPE A
    200 Type set to ASCII.
    PROT P
    200 PRIVATE data channel protection level set
    PASV
    227 Entering Passive Mode (66,181,11,82,4,0).
    LIST
    150 Opening ASCII data connection for directory listing
  •  05-07-2007, 2:32 PM Post no. 5198 in reply to 5197

    Re: FTP I/O error when trying to send file

    The log and code that you posted for our component is not using SSL/TLS, whereas you use it for FireFTP. Did you try a secure connection with our component? If so, can I see the code and the log when it fails?
    André
    Software Developer
    Xceed Software Inc.
  •  05-08-2007, 4:41 PM Post no. 5199 in reply to 5198

    Re: FTP I/O error when trying to send file

    Here's code I wrote that fails. I believe this is pretty much exactly like the sample in your docs. I am also using the same code to connect to a different client's ftp server with no hickups. the client that is failing is using wsftp for their ftp server. I removed our license key & the ip address & username/pass. I'm working to get a test username/pass to give you.


    public void Send()
    {
    Licenser.LicenseKey = "";
    AsyncFtpClient client = new AsyncFtpClient();
    client.Timeout = 20;
    client.PassiveTransfer = true;
    client.CertificateReceived += new CertificateReceivedEventHandler(client_CertificateReceived);
    using (client.TraceWriter = new StreamWriter(@"ftp.log", true))
    {

    AuthenticationMethod authentication = AuthenticationMethod.Tls;
    client.Connect("", 990, authentication, VerificationFlags.None, null);
    Logger.LogDebug("Connected to " + "");
    client.Login("", "");
    Logger.LogDebug("Logged in as " + "aviacode");
    client.SendFile("sample.txt");
    Logger.LogDebug("File Sent - " + "Sample.txt");
    client.Disconnect();
    }
    client.CertificateReceived -= new CertificateReceivedEventHandler(client_CertificateReceived);
    }

    static void client_CertificateReceived(object sender, CertificateReceivedEventArgs e)
    {
    e.Action = VerificationAction.Accept;
    }


    here's the log from a session using this code. the log terminates after the 150 command

    Connected to 66.181.11.82:990 on 5/8/2007 @ 2:22:51 PM
    < 220
    > USER aviacode
    < 331 Password required
    > PASS *****
    < 230-user logged in
    < Welcome to Imaging Service's Transcription FTP Server
    < Please do not use this for anything other than what it was intended
    < 230 user logged in
    > TYPE I
    < 200 Type set to IMAGE.
    > PASV
    < 227 Entering Passive Mode (66,181,11,82,4,0).
    > STOR sample.txt
    < 150 Opening BINARY data connection for sample.txt
  •  05-09-2007, 1:14 PM Post no. 5200 in reply to 5199

    Re: FTP I/O error when trying to send file

    Can you write to <a href="mailto:support@xceedsoft.com">support</a>, so we can connect to your server and try to identify the problem?
    André
    Software Developer
    Xceed Software Inc.
  •  01-19-2010, 4:25 PM Post no. 25472 in reply to 5188

    Re: FTP I/O error when trying to send file

    I have the same error message on one computer. Works fine on another machine. Get the message on SendFile. No errors in the CommandLogFilename.
  •  02-16-2010, 11:01 AM Post no. 25804 in reply to 25472

    Re: FTP I/O error when trying to send file

    Hi,

    There is a lot of things that can happen that can make a FTP session fail. 

    We need more information.  If possible, an access to your FTP server so we can analyze the communication.  Send this information at support@xceed.com with a reference to the forum message id. 

    Regards


    Ghislain
    Technical Support and software developer
    Xceed Software Inc.
    Knowledge Base : http://xceed.com/kb/
    Update Center : http://xceed.com/updates/
    Documentation Center : http://xceed.com/doc/
    For everything else, there is Google
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.