login about faq

One urgent requirement. The DateTime on the uploaded file is set to current DateTime after ckftp2_AsynPutFileStart() . I want the local file date to be retained on remote server too.

  • Allan

asked Jul 18 '13 at 08:36

AllanF's gravatar image


You can try using SetRemoteFileDateTime, SetRemoteFileDateTimeString or SetRemoteFileDt to set the remote file datetime after uploading it. Note that not all FTP servers support setting a remote file date, so the call will fail in this case.


answered Jul 18 '13 at 08:58

jpbro's gravatar image

jpbro ♦

edited Jul 18 '13 at 08:59

There is function SetRemoteFileDateTimeStr() but the format of date it expects is in String. What will the exact pattern be? Can I convert from a Delphi date ?

(Jul 18 '13 at 09:11) AllanF

Here's what the documentation says about SetRemoteFileDateTimeStr (note that this is the ActiveX documentation, but the details should be the same for other versions):

Sets the last-modified date/time of a file on the FTP server. The dateTimeStr should be a date/time string in RFC822 format, such as "Tue, 25 Sep 2012 12:25:32 -0500".

*Important: Not all FTP servers support this functionality.*

Here's a Chilkat blog post that might be of interest too


answered Jul 18 '13 at 09:24

jpbro's gravatar image

jpbro ♦

edited Jul 18 '13 at 09:25

How do you sync files if date does not match with original local files

(Jul 18 '13 at 09:44) AllanF

To be honest, I don't use FTP for anything, so I'm not sure what the best approach is.

However, I do see the following methods in the Chilkat FTP2 library that may be of use: SyncLocalDir, SyncLocalTree, SyncRemoteTree, and SyncRemoteTree2. I would spend some time reviewing the ChilkatFTP2 documentation to see if they (or other methods) are of use.

(Jul 18 '13 at 09:55) jpbro ♦

In fact my question was how does Chilkat do the Sync if the dates are not matching. We cannot Sync only on Size.

My requirements are not met with the readymade Sync, therefore I have created my own RemoteDirectory Tree and done the Sync and all is running real cool. Then suddenly I noticed the date !!

(Jul 18 '13 at 10:12) AllanF

(Just for your Information) Below log from Server. Did AsyncGet correctly, but said File not found for SetRemoteFileDateTimeStr Note: both RemoteFileNames parameter are same and lines are consecutive.

(000102)18/07/2013 19:14:37 PM - ics (> PASV (000102)18/07/2013 19:14:37 PM - ics (> 227 Entering Passive Mode (192,168,0,22,192,237) (000102)18/07/2013 19:14:37 PM - ics (> RETR a.txt (000102)18/07/2013 19:14:37 PM - ics (> 150 Connection accepted (000102)18/07/2013 19:14:38 PM - ics (> 226 Transfer OK (000102)18/07/2013 19:14:38 PM - ics (> MDTM a.txt (000102)18/07/2013 19:14:38 PM - ics (> 213 20130718123754

(000102)18/07/2013 19:14:55 PM - ics (> MDTM 20130717061010 a.txt (000102)18/07/2013 19:14:55 PM - ics (> 550 File not found (000102)18/07/2013 19:14:55 PM - ics (> SITE UTIME 20130717061010 a.txt (000102)18/07/2013 19:14:55 PM - ics (> 504 Command not implemented for that parameter


answered Jul 18 '13 at 09:49

AllanF's gravatar image


It's possible that you need to use the full path of the remote file when calling SetRemoteFileDateTimeStr, however the "Command not implemented for that parameter" message makes me wonder if your FTP server doesn't support changing the remote timestamp anyway.

(Jul 18 '13 at 09:56) jpbro ♦

I tried full path but does not help. For testing I am using FileZilla Server on an LAN setup.

(Jul 18 '13 at 10:08) AllanF

Googled further and decided it is best I upload the Tree file of local datetime stamps and use that later for Sync. Thanks.


answered Jul 18 '13 at 10:25

AllanF's gravatar image


No problem, glad you found a solution. It does sound like the best option since FTP support for changing the remote timestamp is spotty.

(Jul 18 '13 at 10:29) jpbro ♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Jul 18 '13 at 08:36

Seen: 2,880 times

Last updated: Jul 18 '13 at 10:29

powered by OSQA