We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Exists method of FtpClient not working

Hi,


It seems the FtpClient.Exists(path) method is broken, it returns false even though the directory in “path” is on the server. I tried using both /directory and \directory as path values, it didn’t make a difference.

Hi,

Thank you for considering Aspose.

I am unable to replicate your said issue with latest version of Aspose.Network for .NET v6.9.0. Please check the below source code for your reference.

C#

var client = new Aspose.Network.Ftp.FtpClient(“[ftp.microsoft.com](http://ftp.microsoft.com/)”, 21, “anonymous”, "anonymous@aspose.com");

client.Connect(true);
if (client.Connected)
{
Console.WriteLine(client.WelcomeMessage);
if (client.Exists(@"/developr/"))
Console.WriteLine(client.GetFileSize(@"/developr/readme.txt"));
}

If your problem persists then please provide us the following,

  • Server software environment ? It’s OS and IIS version?
  • The exception stack if you get any?
  • Your source code snippet?
  • If possible, provide us your environment (your ftp server) for debugging?