N
NevilleT
I am trying to download a text file from a web site using the following code.
'--------------------------------------------
' Get the file from the Internet
If funIsNetConnected = True Then ' Check for an Internet
connection
lngRetVal = URLDownloadToFile(0, strTextFileURL, strLocalTextFile,
0, 0)
' Download the new file. If successful lngRetVal = 0
DoEvents
Else
GoTo Exit_subGetVersion ' No
Internet connection so exit.
End If
I am using a function (funIsNetConnected) to check for a connection to the
net.
strTextFileURL is the path to the file on the net. Once downloaded, the
text file contains the latest version and build number which I use to see if
there is an update to the program available.
The file seems to download without a problem however I am getting an old
version of the text file. In other words, if I change the text file on the
server, I still download the old version. I suspect somewhere it is being
cached, and rather than download the file, it is pulling a copy from a cache.
The speed at which the download occurs would confirm this. I have tried
deleting the file after I read it using
fso.DeleteFile (strLocalTextFile)
Has anyone had a similar experience with URLDownloadToFile and is there a
way to clear a cache before downloading?
'--------------------------------------------
' Get the file from the Internet
If funIsNetConnected = True Then ' Check for an Internet
connection
lngRetVal = URLDownloadToFile(0, strTextFileURL, strLocalTextFile,
0, 0)
' Download the new file. If successful lngRetVal = 0
DoEvents
Else
GoTo Exit_subGetVersion ' No
Internet connection so exit.
End If
I am using a function (funIsNetConnected) to check for a connection to the
net.
strTextFileURL is the path to the file on the net. Once downloaded, the
text file contains the latest version and build number which I use to see if
there is an update to the program available.
The file seems to download without a problem however I am getting an old
version of the text file. In other words, if I change the text file on the
server, I still download the old version. I suspect somewhere it is being
cached, and rather than download the file, it is pulling a copy from a cache.
The speed at which the download occurs would confirm this. I have tried
deleting the file after I read it using
fso.DeleteFile (strLocalTextFile)
Has anyone had a similar experience with URLDownloadToFile and is there a
way to clear a cache before downloading?