1

I have seen similar questions in the past but not directly related to FluentFtp NuGet package.

How can I keep the last modified date from the sender to the receiver when I am uploading a single file?

Looks like the default is not to preserve it, is there anyway of doing it manually?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Yossi Sternlicht
  • 740
  • 1
  • 6
  • 17

1 Answers1

0

FluentFtp won't do it for you. You have to code that yourself. Use FtpClient.SetModifiedTime:

ftpClient.SetModifiedTime(remotePath, File.GetLastWriteTime(localPath));

But first, make sure your FTP server supports it. Check if any GUI/commandline FTP client can preserve timestamps of the uploaded files on your server.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992