+1 vote

Hello. Why i cant get hash file on server? My code:

FtpItem item = (FtpItem)listView1.Items[i].Tag;
if (item.IsFile)
{
    string path = ftpClient.GetCurrentFolder() + "/" + item.Name;
    byte[] hash = ftpClient.GetFileHash(path , FtpHashType.CRC);
    listView1.Items[i].SubItems[3].Text = hash.ToString();
}

Variable path is correct, I can download it, but when I try get hash I get error:
Unknown command.

by

1 Answer

+1 vote
 
Best answer

There is a good chance your server is not supporting this command.

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

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

If hashTypes is empty it means your server doesn't support server side hash computation.

by (297k points)
...