Using Inet API Check File Date FTP
Using Inet API Check File Date FTP
Using Inet API Check File Date FTP
Using Inet API Check File Date FTP
Using Inet API Check File Date FTP
Using Inet API Check File Date FTP Using Inet API Check File Date FTP Using Inet API Check File Date FTP Using Inet API Check File Date FTP Using Inet API Check File Date FTP Using Inet API Check File Date FTP Using Inet API Check File Date FTP Using Inet API Check File Date FTP
Using Inet API Check File Date FTP Using Inet API Check File Date FTP
Using Inet API Check File Date FTP
Go Back  Xtreme Visual Basic Talk > > > Using Inet API Check File Date FTP


Reply
 
Thread Tools Display Modes
  #1  
Old 10-10-2015, 05:18 AM
hansgrgenstein hansgrgenstein is offline
Newcomer
 
Join Date: Jul 2014
Posts: 5
Question Using Inet API Check File Date FTP


Quote:
Originally Posted by ZeroEffect View Post
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?

Last edited by Cerian Knight; 10-10-2015 at 08:36 PM. Reason: Resolved dupe after split issue
Reply With Quote
  #2  
Old 10-10-2015, 02:02 PM
dilettante's Avatar
dilettanteUsing Inet API Check File Date FTP dilettante is offline
Underclocked lifestyle

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

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
  #3  
Old 10-11-2015, 07:23 AM
hansgrgenstein hansgrgenstein is offline
Newcomer
 
Join Date: Jul 2014
Posts: 5
Default

hi dilettante, thx

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

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 
Reply With Quote
  #4  
Old 10-11-2015, 01:46 PM
dilettante's Avatar
dilettanteUsing Inet API Check File Date FTP dilettante is offline
Underclocked lifestyle

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

Quote:
Originally Posted by hansgrgenstein View Post
is there a place in the internet area where you're not active?
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?
Reply With Quote
  #5  
Old 10-12-2015, 02:31 AM
hansgrgenstein hansgrgenstein is offline
Newcomer
 
Join Date: Jul 2014
Posts: 5
Default

yes, like this:
webUrl="http://bloodysunday.weebly.com/uploads/4/5/6/0/45602969/S"
fileName="data.zip"
Reply With Quote
  #6  
Old 10-14-2015, 07:14 AM
fafalone fafalone is offline
Freshman
 
Join Date: May 2010
Posts: 34
Default

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.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Using Inet API Check File Date FTP
Using Inet API Check File Date FTP
Using Inet API Check File Date FTP Using Inet API Check File Date FTP
Using Inet API Check File Date FTP
Using Inet API Check File Date FTP
Using Inet API Check File Date FTP Using Inet API Check File Date FTP Using Inet API Check File Date FTP Using Inet API Check File Date FTP Using Inet API Check File Date FTP Using Inet API Check File Date FTP Using Inet API Check File Date FTP
Using Inet API Check File Date FTP
Using Inet API Check File Date FTP
 
Using Inet API Check File Date FTP
Using Inet API Check File Date FTP
 
-->