This project is read-only.

item.Modified or item.Created not returning values

Apr 7, 2014 at 4:06 PM
Hi there,

Hi. I am trying to get the "modified"-date from a pdf-file on my FTP-Server (which is a NAS actually).

It most of the time returns: "01.01.0001 00:00:00"
in the "input" string it returns the correct value.

The code I use:
            sftp.Host = GetConfig("FTP_ENVIRONMENT");
            sftp.Credentials = new System.Net.NetworkCredential(GetConfig("NAS_USER"), GetConfig("NAS_PWD"));
            sftp.EncryptionMode = FtpEncryptionMode.Explicit;
            sftp.ValidateCertificate += new FtpSslValidation(OnValidateCertificate);
foreach (FtpListItem item in sftp.GetListing(ftppath))
            {
DateTime modified= item.Modified;

//want to do something with modified here...
}
Coordinator
Apr 7, 2014 at 4:17 PM
Add the SizeModify list options to your GetListing() call. If that doesn't do it then post a transaction log (see the debugging example).
Nov 6, 2014 at 11:10 AM
What about item.Created?