c# - vsftpd 和 FluentFTP - 如何使用 "Ftp.Gethash("FileName") 自动检查文件

c# - vsftpd and FluentFTP - how automatic file checking with "Ftp.Gethash("FileName")

C#编程问题
OS:Debian 9
FTP 服务器:vsftpd
DLL:FluentFtp

FluentFTP提供了很多不用下载就可以通过hash验证文件完整性的方法,例如:

GetHash() - Gets the hash of an object on the server using the currently selected hash algorithm. Supported algorithms are available in the HashAlgorithms property. You should confirm that it's not equal to FtpHashAlgorithm.NONE (which means the server does not support the HASH command).`

但是当我尝试调用时:

Ftp.HashAlgorithms.ToString());

我明白了

None

当我尝试调用时:

Ftp.GetHash("test.exe"));

我得到:

FluentFTP.FtpCommandException: 'Unknown command.'

当我尝试调用时:

Ftp.SetHashAlgorithm(FtpHashAlgorithm.MD5);

我得到:

System.NotImplementedException: 'The hash algorithm MD5 was not advertised by the server`

看来我的 vsftpd 服务器不支持文件散列。有人有解决方案吗?

谢谢,

vsftpd FTP服务器不支持任何校验和计算命令。


类似问题见:

  • FTP: copy, check integrity and delete

支持校验和计算的 vsftpd 的常见替代品是 ProFTPD (with mod_digest module)。