Bug in CalculateFileChecksum function?
I'm using the latest WinSCP .NET Assembly and PowerShell 7 and seem to get the wrong MD5 checksum returned if the filename has any spaces in it. My remote system is Box.com data and I'm downloading files then checking the MD5 checksum of both local and remote files.
In fact, any file that has spaces in it's name on Box returns the exact same MD5 check sum of
Client code:
Below is the WinSCP log and you can see quotes are shown for files with spaces in first line and double quotes on the second line. If the file name does not have spaces, the log shows no quotes at all.
Any ideas where this is doing wrong?
In fact, any file that has spaces in it's name on Box returns the exact same MD5 check sum of
D41D8CD98F00B204E9800998ECF8427E
. If I copy the file on Box and remove the spaces in the name, the MD5 is calculated correctly as returned from the server and for the local file that was copied.
Client code:
$remoteChecksumBytes = $session.CalculateFileChecksum("md5", $remoteFilePath)
> 2022-10-07 16:47:46.620 XMD5 "/TEST/1 perceptions.pdf" < 2022-10-07 16:47:46.669 251 ""/TEST/1 perceptions.pdf"" D41D8CD98F00B204E9800998ECF8427E > 2022-10-07 16:47:50.112 XMD5 "/TEST/Joe Smith.pdf" < 2022-10-07 16:47:50.160 251 ""/TEST/Joe Smith.pdf"" D41D8CD98F00B204E9800998ECF8427E