Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Download text file from website
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00941665
Message ID:
00950877
Views:
13
Hi Bill,

The following code downloads robots.txt file from http://www.microsoft.com
DECLARE INTEGER URLDownloadToCacheFile IN urlmon;
	INTEGER lpUnkcaller, STRING szURL, STRING @szFileName,;
	INTEGER dwBufLength, INTEGER dwReserved, INTEGER pBSC

LOCAL cRequest, nResult, cTargetFilename
cTargetFilename = Repli(Chr(0), 250)
cRequest = "http://www.microsoft.com/robots.txt"

WAIT WINDOW NOWAIT "Downloading remote file..."
nResult = URLDownloadToCacheFile(0, cRequest,;
	@cTargetFilename, Len(cTargetFilename), 0,0)
	
cTargetFilename = STRTRAN(cTargetFilename, Chr(0), "")
IF FILE(cTargetFilename)
	MODIFY FILE (cTargetFilename) NOWAIT
ENDIF

WAIT CLEAR
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform