Xtreme Visual Basic Talk

Xtreme Visual Basic Talk (http://www.xtremevbtalk.com/)
-   Communications (http://www.xtremevbtalk.com/communications/)
-   -   Using Inet API Check File Date FTP (http://www.xtremevbtalk.com/communications/327883-using-inet-api-check-file-date-ftp.html)

hansgrgenstein 10-10-2015 06:18 AM

Using Inet API Check File Date FTP
 
Quote:

Originally Posted by ZeroEffect (Post 1103273)
Here is what I'm trying to do.

1. Check the date of a file on an FTP server.
2. If the date has Changed download the file.
3 If the date hasn't changed check again later.

I know how to get file information from a file that is on my computer or one on a network drive. But how can I get this information with out downloading the whole file first.

Thanks

ZeroEffect

How'd you solve these three problems?

dilettante 10-10-2015 03:02 PM

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.

hansgrgenstein 10-11-2015 08:23 AM

hi dilettante, thx

is there a place in the internet area where you're not active? :D

it is sufficient to link and I will continue to explore , thanks

i try this, but not work:

PHP Code:

option explicit
dim tempDate 
as string
dim webURL 
as string
dim fileName 
as string
 
webURL
="www.mypage.com/bla/bla/"
fileName="myFile.zip" 

Inet1.Execute webUrl"HEAD" fileName
tempDate 
Inet1.GetHeader("Date")
msgbox tempDate 


dilettante 10-11-2015 02:46 PM

Quote:

Originally Posted by hansgrgenstein (Post 1409073)
is there a place in the internet area where you're not active? :D

I probably just use the same alias unlike others who seem to constantly use different ones. Maybe they get banned a lot?


Have you tried using http:// in your URL?

hansgrgenstein 10-12-2015 03:31 AM

yes, like this:
webUrl="http://bloodysunday.weebly.com/uploads/4/5/6/0/45602969/S"
fileName="data.zip"

fafalone 10-14-2015 08:14 AM

I'm not too familiar with it; but if you based your FTP connection on wininet APIs, wouldn't it come with the LS command? Every FTP client I've seen is able to display dates and times that way. Or if you're only dealing with one file (or if you reconnect according to docs), the FtpFindFirstFile API? That returns a WIN32_FIND_DATA structure that should have the date/time.


All times are GMT -6. The time now is 10:00 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Optimisation provided by DragonByte SEO v2.0.15 (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
All site content is protected by the Digital Millenium Act of 1998. Copyright©2001-2011 MAS Media Inc. and Extreme Visual Basic Forum. All rights reserved.
You may not copy or reproduce any portion of this site without written consent.