Get remote file's timestamp using FTPS

0 votes
asked Jan 26, 2012 by dm3281 (230 points)
edited Jan 26, 2012

Hi, I would like to pull the timestamp of a remote file via FTPS.

Is there a way to do this with Rebex? I saw a post about SFTP and some sFtpAttributes, but couldn't find anything for FTPS.

Applies to: Rebex FTP/SSL

1 Answer

0 votes
answered Jan 26, 2012 by Tomas Knopp (58,890 points)
edited Jan 26, 2012


please use the GetFileDateTime() method of the Ftp class to get the modification date and time of the specified remote file, e.g.

// connect and login...
Ftp ftp = new Ftp();

// get the modification datetime
DateTime dt = ftp.GetFileDateTime("fileName");

The GetFileDateTime method represents the FTP MDTM command. Please note the MDTM command was not defined by the original RFC, but it has been widely supported for a number of years. And also please note some servers return times in their local time zones, some use GMT.