0 votes

This is my code

client.Upload("/Paracial3Papita/jojo.xml", @"D:\jojo.txt");

here is the error in the serverHash

Limilabs.FTP.Client.FtpResponseException: 'Syntax error, command unrecognized.'

byte[] serverHash = client.GetFileHash(Paracial3Papita/jojo.xml", FtpHashType.CRC);

FileHash hash = new FileHash(FtpHashType.CRC);
bool hashIsValid = hash.IsValid(@"D:\\jojo.txt", serverHash);

client.Close();
by
edited by

1 Answer

0 votes

Most likely this means that your FTP server is not supporting CRC hashes (XCRC command).

You can use Ftp.GetSupportedHashTypes method to get hashes supported
by your server:

List<FtpHashType> hashTypes = ftp.GetSupportedHashTypes();

If you want hashing to work, you need to choose an FTP server that supports one of the following commands:

  • XCRC,
  • XMD5,
  • XSHA,
  • XSHA1,
  • XSHA256,
  • XSHA512

Please note, that using SSL/TLS eliminates the need of verifying hashes
FTP over SSL/TLS (FTPS) ensures your data stays intact during transfer.

by (297k points)
...