I have a Timer on my page that on interval of 500ms it checks the existence of a file being downloaded...
I call my Download code, and then the timer starts and checks the existence of the file first and then the filesize... I am passing the completed size to a function that the timer is calling every 500ms and do a simple math formula Round((CurrentFileSize / CompletedSize) * 100,0) to fill a progress bar up, but it seems that the timer doesnt run while the download is happening.... then all the sudden the progress bar goes all the way to the right and starts the next download.
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True
Private Sub Form_Load()
DownloadFile "http://www.mydomain.com/myzip.zip", "c:\downloads"