Archived Forum Post

Index of archived forum posts

Question:

SFTP set LastModifiedTime

May 12 '14 at 12:34

I need to copy files from windows to a UNIX server, and I am able to do so using UploadFileByName, but the LastModifiedTime is set to (Now) instead of keeping the original file's LastModifiedTime.

When I use a WinSCP, the LastModifiedTime is reatined.

Suggestions?

Thanks for your time


Answer

I think the last-modified time should be maintained. Maybe you're using an older version? Chilkat uses it's own products internally, especially the SFTP functionality for synchronizing local directory trees with remote directory trees -- which wouldn't work unless last-mod times were maintained (and I use this functionality daily with many servers..)


Answer

This is fixed in v9.5.0.40.

The PreserveDate property now affects both uploads and downloads. Starting in v9.5.0.40, the UploadFileByName method will preserve the last-mod date/time for the file that is uploaded.

Note: The SyncTreeUpload/Download methods already preserve the last-mod date/times regardless of the PreserveDate property setting.

Please let me know the exact build you require (programming language, operating system, etc.) and I will provide a pre-release..