Preserving the Original Time Stamp of an Uploaded File - KB Article #1058Related Articles --
Serv-U supports the MDTM command. This allows any FTP Client that also supports the MDTM command to upload a file and preserve the time and date stamp on the file. To make sure this option is enabled in Serv-U:
- Open the Serv-U Management Console.
- Select the domain you have set up.
- Select Limits & Settings.
- Select FTP Settings, and then double-click the MDTM command. The Information tab contains a check box to enable this feature. The feature is enabled by default.
At the time of this writing not many FTP client programs support the command. FTP Voyager is one. The command line FTP client lets you send this by adding the MDTM command, using the format "mdtm 19980525162603 file.txt".
This command originates in UNIX and lets you query the server for the modification date and time of a file or directory. Unlike UNIX, FTP Serv-U also lets the client set the modification date and time of files on the server, if the user has sufficient access rights to do this. Its use is in synchronizing uploaded files with those on the client.
Normally FTP has no way to explicitly set the date of uploaded files, they simply get the date they were created on the server. MDTM lets the client change that so they get the date of the original file on the server. Works for directories too. The syntax to set the date and time is:
Where 'yyyymmddhhmmss' is a line of text with the year, month, day, hour, minutes, and seconds the file should get set to. The next part, '[+-xxx] ', is optional time zone information of the FTP client in minutes relative to UTC.
If the client provides this info FTP Serv-U takes care to convert the date and time to the proper local time at the server, so dates and times are kept consistent (a file created at 4 in the morning in the Eastern US would be created at 10 in Central Europe). If no time zone info is given FTP Serv-U assumes you are specifying local time at the server.
An example, showing how to set the time if the client is in the Eastern US during summer time: MDTM 19980719103029-240. This sets the date and time to 19 July 1998, 10:30am 29 seconds, and indicates the client is 240 behind UTC.