Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Signs of progress
Message
From
24/03/2013 17:43:02
 
 
To
24/03/2013 16:50:29
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01569160
Message ID:
01569162
Views:
95
>Hi All,
>
>I'd like display a progress bar when my app downloads files from my website. I'm using urldownloadtofile().
>How can I return: a) the file size, and; b) the number of bytes at any given point?
>Thanks.
>
>Luke

(1) you open internet with InternetOpen() api
(2) you open the file with InternetOpenUrl() api
(3) you use HttpQueryInfo() api - to get the filesize of the handle returned in (2)
(4) in a loop, you use InternetReadFile() api until no bytes have been read
You add the number of bytes read with InternetReadFile() api - that's the number to display in the progressbar

(5) you close the handle of (2) with InternetCloseHandle() api
(6) you close the handle of (1) with InternetCloseHandle() api

I think that's about it
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform