0

I need to change the date of the remote file via Chilkat's FTP Component. I have used CkFtp2_getAutoFeat(pFtpClient) so as to activate the features of the server.

wDate:='Mon, 20 Oct 2016 16:35:00 -0500' 
CkFtp2_SetRemoteFileDateTimeStr(pFtpClient,pWideChar(wDate),pWideChar(wHostFileName)) ;

Gives Error

'<ChilkatLog>'#$D#$A'<SetRemoteFileDateTime>'#$D#$A'<DllDate>Dec 13 2012</DllDate>'#$D#$A'<UnlockPrefix>xxxxxx</UnlockPrefix>'#$D#$A'<Username>VMAF:user</Username>'#$D#$A'<Architecture>Little Endian; 32-bit</Architecture>'#$D#$A'<Language>C++ Builder XE2</Language>'#$D#$A'<VerboseLogging>0</VerboseLogging>'#$D#$A'<DateTime>Thu, 20 Oct 2016 21:35:00 GMT</DateTime>'#$D#$A'<info>Trying MDTM...</info>'#$D#$A'<info>Trying SITE UTIME...</info>'#$D#$A'<error>Failed.</error>'#$D#$A'</SetRemoteFileDateTime>'#$D#$A'</ChilkatLog>'#$D#$A

With another delphi component (TFTPClient from ICS) the date changes using same server.

I am using an older Chilkat Dll version as I am comfortable with that and all works fine except the date change.

I am using Delphi Dll, Chilkat Ftp2, ICS TFTPServer component, Windows OS

Regards

Aura
  • 95
  • 6
  • The log you provided shows a `SITE UTIME` command being sent and fails. ICS's `TFtpClient` and `TFtpServer` do not implement `SITE UTIME` at all, they only support `MFMT` and `MDTM` instead (`TFtpServer` supports both. `TFtpClient` sends either one depending on server capabilities) – Remy Lebeau Oct 29 '18 at 18:46
  • In the error there is Trying MDTM .. first and then Trying SITE UTIME. – Aura Oct 30 '18 at 10:25
  • but the log doesn't show which format of MTDM it tries, or what the result was. I also see `VerboseLogging` is 0, can you enable more detailed logging? Will it then log the *actual* commands and replies being exchanged? – Remy Lebeau Oct 30 '18 at 15:03
  • I made verbose logging true but the message did not change at all, except VerboseLoggin became 1 – Aura Oct 31 '18 at 04:20
  • Why are you passing the string parameters as `PWideChar` when the function is [declared](https://github.com/chilkatsoft/Chilkat-PHP-Extension/blob/master/chilkat/ChilkatLib/Package/include/C_CkFtp2.h) to use `char*` (`PAnsiChar` in Delphi) instead? Do you have the same problem if you use `CkFtp2_SetRemoteFileDateTime()` or `CkFtp2_SetRemoteFileDt()` instead? – Remy Lebeau Oct 31 '18 at 04:34
  • Same Error `wSetFeat:=CkFtp2__Feat(pFtpClient) ; // Returns '211-Extensions supported: HOST SIZE REST STREAM MDTM MDTM YYYYMMDDHHMMSS[+-TZ] filename MLST size*;type*;perm*;create*;modify*; MFMT MD5 XCRC "filename" start end XMD5 "filename" start end CLNT SITE INDEX;ZONE;MSG;EXEC;PSWD;CMLSD;DMLSD XCMLSD XDMLSD 211 END' wDate:='Tue, 30 Oct 2016 16:43:00 +0530' ; DtTm:=CkDateTime_Create() ; CkDateTime_SetFromRfc822(DtTm,pWideChar(wDate)) ; // Returns True CkFtp2_SetRemoteFileDt(pFtpClient,DtTm ,pWideChar(wHostFileName)) ; CkDateTime_Dispose(DtTm) ;` – Aura Oct 31 '18 at 09:51

0 Answers0