Page 1 of 1 1
Topic Options
#178529 - 2007-07-27 11:23 PM An observation regarding UDF FTPGet()
green78 Offline
Fresh Scripter

Registered: 2007-05-02
Posts: 34
Hi folks,

I started using the FTPGet() function and for the first few days it worked fine, then on the 5th day some bug appeared. Here's how I'm using the function:

Every day I download an XLS file from a website. Every day the file name is the same, but the file is being updated. Once downloaded, I open the file, read a value inside and if it corresponds with today's date I send the file via Blat SMTP to some people.
I have to send the file after 16:45, so at this point the script starts downloading the file from the web address every 2 minutes. In 99% of the cases by this time file is already updated and file is being sent.
Sometimes though, I see the file downloaded, but when I open it - still shows the previous date inside, while when I open it from another PC (downloaded from the website) it is updated. The script though keeps on downloading the file every two minutes and it is never updated, while at the very same time I see it updated on the site.
So, conclusion is that it is getting cached and I implemented the ClearIE() UDF into the script, but this behaviour is very strange - 4 days it works perfrectly (without clearing the cache) while on the 5th day (not always the fifth day, but somewhere in this period) the cache is not getting updated.

Any thoughts why this might be happening ? ClearIE() works well, but I'd prefer not using it so often.

Thanks in advance !


Edited by green78 (2007-07-27 11:25 PM)

Top
#178531 - 2007-07-28 08:47 AM Re: An observation regarding UDF FTPGet() [Re: green78]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
So ClerIE() solves your problem?
Top
#178532 - 2007-07-28 09:57 AM Re: An observation regarding UDF FTPGet() [Re: Witto]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
ftpGet() doesn't set your IE cache settings.
you should set it manually via registry hack or the GUI and force it to check always for updated content.
_________________________
!

download KiXnet

Top
#178536 - 2007-07-28 04:33 PM Re: An observation regarding UDF FTPGet() [Re: Lonkero]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
IE Registry settings - http://support.microsoft.com/kb/182569
_________________________
Today is the tomorrow you worried about yesterday.

Top
#178537 - 2007-07-28 10:13 PM Re: An observation regarding UDF FTPGet() [Re: Lonkero]
green78 Offline
Fresh Scripter

Registered: 2007-05-02
Posts: 34
 Originally Posted By: Jooel
hmm...
ftpGet() doesn't set your IE cache settings.
you should set it manually via registry hack or the GUI and force it to check always for updated content.


Sure this is solution, but I was wondering why it should happen on a Friday :).

Thanks guys, I think this will help.

Top
#178538 - 2007-07-29 10:51 AM Re: An observation regarding UDF FTPGet() [Re: green78]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
LOL

I guess FTPGet felt like giving you some sh#t to start the weekend with.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#178546 - 2007-07-30 04:19 PM Re: An observation regarding UDF FTPGet() [Re: Mart]
green78 Offline
Fresh Scripter

Registered: 2007-05-02
Posts: 34
Hi again,

Actually ClearIE() doesn't solve the problem - I tried to execute it every time before the download but still it will pick up the old version of the file - I have no idea how this happens because I actually see that the file is getting deleted from "Temporary Internet files".

Anyway, the issue was that I have to set IE to check for new version on "Every visit" - once I set it, it immediatelly downloaded the new version.

Now I have another problem: Since we are using SOE (Standard Operating Environment) for Windows 2000 and I'm afraid if settings may be auto-restored on next logon -- I'd like to ask if there is some way to force set this option before the download starts via Kix ?

Thanks in advance !

Top
#178549 - 2007-07-30 06:24 PM Re: An observation regarding UDF FTPGet() [Re: green78]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
That should be the syncmode5 setting in the reg.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#178550 - 2007-07-30 07:13 PM Re: An observation regarding UDF FTPGet() [Re: Les]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
This is in VB but it's just writing a value to the registry so it can easily be done with the build-in writevalue function inKiXtart. Also possible using a GPO but you might have to make and ADM file for it.

Hey, Scripting Guy! How Can I Make Internet Explorer Check for a New Version Each Time I Visit a Web Page?

 Quote:

Go to HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\SyncMode5.
Change the value of syncmode5 to
3 - Every visit to the page.
2 - Every time you start internet explorer
4 - Automatically
0 - Never
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#178551 - 2007-07-30 07:41 PM Re: An observation regarding UDF FTPGet() [Re: Mart]
green78 Offline
Fresh Scripter

Registered: 2007-05-02
Posts: 34
Mart/Les,

Thanks a lot. I think this time issue is solved. Maybe a modification to the FTPGet() function will be also useful in the following manner or at least the below usage is very advisable:

 Code:
$RegVal = Readvalue( "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings","Syncmode5")
writevalue( "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings","Syncmode5","3","REG_DWORD")

FTPGet()

writevalue( "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings","Syncmode5",$RegVal,"REG_DWORD")


Today I figured it out. In the morning I logged in manually and downloaded the file. When it became time for the script to download the file it was downloading only the old version, even though the version on the site was updated.
Most of the time the script was working, because when it was trying to download it the file was already updated on the site. What happened on Friday (because the guys that update it were lazy enough \:\) ) by the time the script downloaded it for the first time it was not updated, then after 10-15 mins or so it was updated on the site, but the script was still downloading the old version - even though cache was cleared each time before download (which is still a mystery to me).

Cya.

Top
#178553 - 2007-07-30 08:19 PM Re: An observation regarding UDF FTPGet() [Re: green78]
green78 Offline
Fresh Scripter

Registered: 2007-05-02
Posts: 34
By the way.... the above can happen if you use proxy server to access the Web. This explains why even cache is cleared - it doesn't help. The first donload is stored on the proxy and each next attempt to download without the proper settings in IE results in downloading the file from the proxy.

You shouldn't have this problem if you access internet directly.

Top
#178644 - 2007-08-02 06:50 PM Re: An observation regarding UDF FTPGet() [Re: green78]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
but again note, the clearIE() doesn't actually clear anything from the cache.
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.078 seconds in which 0.037 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org