Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Too much security
Message
De
09/11/2016 18:13:20
 
 
À
09/11/2016 15:41:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Network:
Windows Server 2016
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01643005
Message ID:
01643022
Vues:
118
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform