I want to perform the checksum MD5 control after the upload of file to FTP(S) server.
What steps should I follow in C#? I think I have to use the XMD5
command on FTPS server and get the result.
But I do not know how to do it.
Thanks
I want to perform the checksum MD5 control after the upload of file to FTP(S) server.
What steps should I follow in C#? I think I have to use the XMD5
command on FTPS server and get the result.
But I do not know how to do it.
Thanks
You cannot execute random FTP commands using .NET FtpWebRequest
, nor any other built-in .NET class.
You have to use a 3rd party FTP library for this.
For example WinSCP .NET assembly has Session.CalculateFileChecksum
method. The method will automatically map checksum algorithm name (as "md5") to an FTP command that the server supports. So if the server supports XMD5
, it will use XMD5
.
(I'm the author of WinSCP)
For some background, see also my answer to:
FTP: copy, check integrity and delete