Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Too much security
Message
From
09/11/2016 18:13:20
 
 
To
09/11/2016 15:41:16
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Network:
Windows Server 2016
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01643005
Message ID:
01643022
Views:
117
>Hi All,
>
>My application has been using URLDownloadToFile() to download a delimited .txt file from a secure (https://) U.S. Gov't website. It was working fine until the other day when I guess someone decided to remove the unsecure http:// redirector, and now it won't work. Is there a solution?
>Thanks.
>
>Luke

You can redefine URLDownloadToFile() to use XMLHTTP:
LOCAL TemporaryFile AS String

m.TemporaryFile = ADDBS(SYS(2023)) + "~test" + SYS(2015) + ".html"

URLDownloadToFile(.NULL., "https://www.google.com", m.TemporaryFile)
MODIFY FILE (m.TemporaryFile)
ERASE (m.TemporaryFile)


FUNCTION URLDownloadToFile (Caller AS Object, URL AS String, FileName AS String, Reserved AS Integer, CallBack AS Object)

	LOCAL XMLHttp AS MSXML2.ServerXMLHTTP60
	LOCAL Result AS Integer
	
	m.XMLHttp = CREATEOBJECT("MSXML2.ServerXMLHTTP.6.0")
	m.XMLHttp.Open("Get", m.URL, .F.)
	m.XMLHttp.Send()
	
	STRTOFILE(m.XMLHttp.Responsebody, m.FileName, 0)

ENDFUNC
----------------------------------
António Tavares Lopes
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform