Connect to Dengage FTP

Connection Details

Protocol: ftps

Host Name: ftps.dengage.com

Port: TCP 990, TCP 30000-50000

Connection Type: Explicit


Sample Codes

You can find the sample codes for connecting to D·engage FTPS below

public static async System.Threading.Tasks.Task ConnectToDengageFtpOverFluentAsync()
        {
	try
	{
	    var client = new FtpClient("ftps.dengage.com")
	    {
	        Port = 990,
	        Credentials = new NetworkCredential("your_ftp_username", "your_ftp_password"),
	        SslProtocols = SslProtocols.Tls12,
	        DataConnectionType = FtpDataConnectionType.AutoPassive,
	        EncryptionMode = FtpEncryptionMode.Explicit,
	        Encoding = Encoding.UTF8,
	        DataConnectionEncryption = true
	    };
	    client.Connect();
	    client.SetWorkingDirectory("");
	    client.ValidateCertificate += new FtpSslValidation(OnValidateCertificate);
	    var workDir = client.GetWorkingDirectory();
	    FtpListItem[] list = client.GetListing(workDir, FtpListOption.UseStat);

	    foreach (FtpListItem li in list)
	    {
	        Console.WriteLine(li.Type + " " + li.FullName);
	    }

	    client.UploadDataType = FtpDataType.Binary;
	    client.UploadFile("c:\\source_folder\\a.txt", "/destination_folder/a.txt");

	    if (client.IsConnected)
	    {

	    }
	}
	catch (Exception ex)
	{
	    throw ex;
	}
        }
	private static void OnValidateCertificate(FluentFTP.FtpClient c, FtpSslValidationEventArgs e)
	{
	    e.Accept = true;
	}
	
private static void WinSCP()
{
	try
	{
	    // Setup session options
	    SessionOptions sessionOptions = new SessionOptions
	    {
	        Protocol = Protocol.Ftp,
	        HostName = "ftps.dengage.com",
	        UserName = "your_ftp_username",
	        Password = "your_ftp_pass",
	        FtpMode = FtpMode.Passive,
	        FtpSecure = FtpSecure.Explicit,
	        PortNumber = 990
	    };

	    using (Session session = new Session())
	    {
	        // Connect
	        session.Open(sessionOptions);

	        // Upload files
	        TransferOptions transferOptions = new TransferOptions
	        {
	            TransferMode = TransferMode.Binary
	        };

	        TransferOperationResult transferResult;
	        transferResult = session.PutFiles(@"c:\source_folder\a.txt", "/destination_folder/", false, transferOptions);
	        // Throw on any error
	        transferResult.Check();

	        // Print results
	        foreach (TransferEventArgs transfer in transferResult.Transfers)
	        {
	            Console.WriteLine("Upload of {0} succeeded", transfer.FileName);
	        }
	    }
	}
	catch (Exception e)
	{
	    Console.WriteLine("Error: {0}", e);
	}
}