Hi, I'm automating the updating of our externally hosted website.
After a ftp upload action, the timestamp on the file is the time of the ftp operation, not the timestamp of the source file. I'd like the timestamp to be preserved as we show the this on the site to help us match up versions.
I can't see any explicit option to preserve timestamps, unless you count the whole page about only updating newer files and skew handling but I don't want to only update new files, just accurately track which time is there.
Having said that, if the remote file always gets the ftp operation time, it makes the 'update newer' option considerably less useful i.e. if you have 2 file versions timestamped A and B (with B > A) and upload up version A at time C, now attempting to update to version B would to nothing since the remote timestamp would be C (the time of A's upload).
So is there something I'm doing wrong or something that needs to be changed on the hosting server end? Is there any ftp action which will sync the timestamps?
I've done some more research into this and it's the well-known MDTM update "trick" that FinalBuilder does not appear to support.
The ftp command to get a remote file timestamp per the RFC's is: MDTM [filename] which returns an ftp timestamp in the following format: YYYYMMDDHHMMSShh
So, the corresponding ftp command to set a remote file timestamp that many servers support is: MDTM [timestamp in above format] [filename]
Admittedly, this is potentially ambigious if your filename looks like a timestamp, although this is seldom an issue. If the server does not support the MDTM set option, you'll get a "no file or directory" error since it will interpret the timestamp as a filename to get a timestamp from and fail.
To resolve these issues, there is the proposed MFxx family of ftp commands but they are less commonly supported in many ftp servers, unlike the MDTM "trick".
I don't know which ftp component set finalbuilder is using (if any), but current Indy versions support MDTM as a server and client which is where I found all the above documented and discussed in their developer blog :-)
FinalBuilder does currently use the Indy libraries for FTP. I’ll put this on the todo list to investigate. I think you should be able to use the FTP Send Command action to work around this situation in the meantime.
OK, is there a FB action to get a file’s timestamp in the above format?
The Get Date/Time option has the format options but there is no action I can see (maybe there’s a action package I need to add back in) which allows this for files
I’ve had a search through the Help and I can’t see anything obvious. Maybe I’m not looking hard enough