Posted: 2012-07-24 10:11
I'm using the WinSCP .NET component to transfer files from a Windows machine (where their "last modified" time is displayed correctly) to a remote server. The "last modified" time is showing up on the server as March 2, 1970. This happens regardless of whether TransferOptions.PreserveTimestamp is set to true or false. When I use a different SFTP client to transfer the files, the "last modified" time shows up correctly on the server.
I understand that according to the SFTP specs (https://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#page-21), the "mtime" field is supposed to be expressed in "Unix time." It seems that the WinSCP .NET component is not correctly converting the NTFS timestamp into this format. It may just be grabbing certain bits directly from the NTPS timestamp and populating the "mtime" field with that, and the server on the receiving end is then interpreting this timestamp (as it should!) as a number of seconds since the Unix epoch.
Any insight or suggestions for a workaround would be greatly appreciated.
Location: Prague, Czechia
WinSCP obviously does that.
Do you see the problem also when using WinSCP GUI?
Please set Session.SessionLogPath and attach the log.
You can post new topics in this forum
And it's free!