Preserving the Last Modified Time with the SFTP Component


By default, the SFTP component does not preserve file timestamps during uploads or downloads. You can enable this feature using the PreserveFileTime configuration setting.

To preserve file times, set the PreserveFileTime property to True:

sftp.Config("PreserveFileTime=True");

This setting ensures that the ModifiedTime and AccessTime of the file are preserved. If you are using SFTP 4.0, the CreationTime will also be preserved.

We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at support@nsoftware.com.