>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