View Single Post
Old 10-10-2015, 02:02 PM
dilettante's Avatar
dilettante dilettante is offline
Underclocked lifestyle

Forum Leader
* Guru *
Join Date: Feb 2005
Location: Michigan, USA
Posts: 4,533

2006 was a long time ago. This should be a new question since some of those involved may have moved on by now.

There isn't any good solution to (1.) because FTP is even less supported by Microsoft today than it was in 2006. You still have the Internet Transfer Control ("Net") or using the UrlMon APIs that lie beneath it, but there is nothing else usuable in VB6 you can consider readily available. 3rd party libraries remain a possible answer.

A better answer is to stop using FTP. Move your file to a higher class of server, such as one using the far less firewall hostile and far better supported HTTP/HTTPS protocol. Then a simple HTTP HEAD request can fetch the file's date with good reliability (though many cheapo/freebie web site hosts return bogus dates), or for better reliability use a WebDAV host and some version of a VB6 WebDAV client class (tons of them have been posted).

Or store a version/timestamp file in parallel with each uploaded data file and check the contents of that.

As for (2.) you can go ahead and use INet/UrlMon. Or run away from FTP and use a better alternative. An HTTP GET request is simple to use, and again a WebDAV file download is simple too.

In any case (3.) is just a matter of keeping track of the last time you checked for a new file. Then whenever your program is "curious" again it can see if enough time has elapsed since it last checked - if so, check again.
Reply With Quote