0 votes
by (230 points)
edited

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
by (58.9k points)
edited

Hello,

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();
ftp.Connect(...);           
ftp.Login(...);

// 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.

...