Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A guy walks into a bar
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01569430
Message ID:
01569502
Views:
69
I have doubts whether FtpOpenFile function should be used at all.

Below is the link to a working code sample. The InternetReadFile API function is called in cycle each time reading a small portion of the remote file. Which makes a progress routine possible.

Using InternetSetFilePointer when resuming interrupted download from the Internet
http://www.news2news.com/vfp/?example=191

API functions used:
CloseHandle
CreateFile
GetFileSize
InternetCloseHandle
InternetOpen
InternetOpenUrl
InternetReadFile
InternetSetFilePointer
OpenFile
SetFilePointer
WriteFile
pcRemotePath = "http://www.php.net/distributions/manual/"
pcFilename = "php_manual_es.chm"
...
phRemote = InternetOpenUrl (hInternet, pcRemotePath + pcFilename,;
            "", 0, INTERNET_FLAG_NEED_FILE, 0)
...
IF InternetReadFile (phRemote, @lcBuffer,;
                    TransferBuffer, @lnBytesRead) <> 0
...
ENDIF
Previous
Reply
Map
View

Click here to load this message in the networking platform