Preserve date modified of files downloaded off of FTP

Coding Camel

Member
Joined
May 14, 2013
Messages
19
Programming Experience
1-3
Hi, i'm wondering if there is any way to preserve the date modified of files downloaded off of an FTP server using My.Computer.Network.Downloadfile

I know you could zip and unzip the file, but it sounds like a lot of trouble.
 
That is information is not part of the ftp transfer. Do a ftp request for GetDateTimestamp afterwards and use the FileInfo class to set LastWriteTime for the local file.
For Ftp clients that does preserve the date stamp, and display command sequences, you may see they do a MDTM after the RETR. Core Ftp is one such client where you can see this.
 
Trying to figure out where i'd put this though.
That's easy, when you have downloaded the file and received the Date value, then you can set it for the local file.
 
I know this, but the only sub classes of Filesysteminfo are Equals and Reference Equals, how would I target something such as


VB.NET:
("C:\TestFolder\" & File)
 
Create the FileInfo object: FileInfo Constructor (System.IO)
Then set its LastWriteTime property.
object.property = value
 
Have a closer look at the code sample for FileInfo class, link in previous post. Understand that you need a FileInfo object.
 
Post got deleted? Anyways, I got the file property working. I didn't see that example part =) I am wondering if there is anyway to open a msgbox whenever Network.Downloadfile completes.
 
Back
Top