Make your own free website on

[an error occurred while processing this directive]

Howto use a progressbar while downloading a file

Actually, this method is quite easy. Instead of downloading the file in one part, we 'split' the file in several parts and download each part after each other. Between two parts, we can update our progress bar:

Const BytesPerTime = 1024
For Cnt = 0 To FileSize Step BytesPerTime
If Cnt + BytesPerTime > FileSize Then
InternetReadFile frmUpdate.hFile, bBytes(Cnt), FileSize - Cnt, Ret
InternetReadFile frmUpdate.hFile, bBytes(Cnt), BytesPerTime, Ret
End If
SetProgressValue Cnt / FileSize * 100
Next Cnt

Read here to download files asynchronously

Copyright © 1998-2000, The KPD-Team.
Send mail to with comments about this web site.
This site is located at