Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4k views
in .NET FTP by (800 points)
Hi Bruce/Hans,

I am back again and again I want help from you people. Everything is working fine with your latest free version. But while FTPing to the UNIX server, I am getting the following error:

Please logout before sending new USER command. (code=503)

The error is coming while trying to login( ftpConn.Login();). But it works fine from command prompt. Please help me to resolve this.

Please have a look at my code here:
private string FTPFile(string strFileFullName, string strToFileName, string strFolderName, string strServerName, string strFTPID, string strPwd, string strActive_YN, string strSiteCommand)
{
    string strReturnVal = "";

    EnterpriseDT.Net.Ftp.FTPConnection ftpConn = new EnterpriseDT.Net.Ftp.FTPConnection();


    try
    {
        ftpConn.ServerAddress = strServerName;
        ftpConn.UserName = strFTPID;
        ftpConn.Password = strPwd;
        if (strActive_YN == "Y")
        {
            ftpConn.ConnectMode = EnterpriseDT.Net.Ftp.FTPConnectMode.ACTIVE;
        }
        else
        {
            ftpConn.ConnectMode = EnterpriseDT.Net.Ftp.FTPConnectMode.PASV;
        }

        ftpConn.TransferType = EnterpriseDT.Net.Ftp.FTPTransferType.ASCII;
        ftpConn.Connect();
        ftpConn.Login();

        ftpConn.ChangeWorkingDirectory(strFolderName);
        if (strSiteCommand.Length > 0)
        {
            ftpConn.InvokeSiteCommand(strSiteCommand);
        }

        ftpConn.UploadFile(strFileFullName, strToFileName);
        ftpConn.Close();
    }
    catch (Exception ex)
    {
        strReturnVal = ex.Message;
        log4.Error("Error while FTPing. File Name: " + strFileFullName + "Error Details: " + ex.Message);
    }

    return strReturnVal;
}

Awaiting fro your reply....

THANKS & REGARDS,

Lita

5 Answers

0 votes
by (51.6k points)
This is simply because you are already logged in. Unless you have set AutoLogin to false, FTPConnection will automatically log in when you call Connect(). So simply remove your call to Login(). This is stated in the help for Connect(), Login() and AutoLogin. Are you able to view the help?

- Hans (EDT)
0 votes
by (51.6k points)
Thanks Hans. I tried the following 2 ways and it gives another error(Failed to accept connection within timeout period (0)).
(1)
ftpConn.AutoLogin= false;
ftpConn.Connect();
ftpConn.Login();

(2) ftpConn.Connect();

Where is the help link? I searched the forum and didn't get any message for this new error. Please help me.

Thanks & Regards,
Lita.


The help is a part of the distribution and is also available here. I don't understand why you are getting this error now. Previously you were able to connect, but were having a problem with your login; now you can't connect. Is this a different server? Please provide more details.

- Hans (EDT)
0 votes
by (800 points)
Yes. I was able to login and able to FTP also. But I was FTPing only to Mainframe machines. I didn't try for a UNIX server. There is a firewall for this unix server too. So, I am using Active Connection.

Before using this latest version, I was using a version which is around 4-5 years old version and at that time I was able to FTP to the same UNIX server.

Please help.

Thanks & Regards,

Lita
0 votes
by (800 points)
Hi Hans,
Please go through my previous reply along with this reply.
I am able to FTP to both UNIX as well as Mainframe servers. But this UNIX box is in our network without having firewall.

The one I want to send is having firewall and not in our network. Also with your that very old version of ftp client, I was able to FTP to that server successfully. But not with this latest one (Note: but able to send to MF & Unix box in the same network).

FYI: All ports are open from both sides.....

Please reply back...I am waiting for that...

Thanks & Regards,

Lita.
0 votes
by (51.6k points)
Are you a customer? If so please e-mail support@enterprisedt so that we can respond to your messages more promptly. If not then you may purchase support from the following page: http://www.enterprisedt.com/products/edtftpj/support.html. If you do not want to do that then you will have to accept that your messages may not be replied to immediately.

- Hans (EDT)

Categories

...