Sistem wrote:deve ser algo no host
If DowlFile("https://bitbucket.org/fivetech/fivewin-contributions/downloads/Fivetechv.png", "e:\Fivetechv.png") // Retorna NAO OK
? "ok"
Else
? "NAO OK"
Endif
If DowlFile("http://www.Pflegeplus.com/DOWNLOADS/Gditest1.zip", "e:\Fivetechv.png") // RETORNA OK
? "ok
Else
? "NAO OK"
Endif
//--------------------------------------------------------------------------------
Function DowlFile(cLink, cDest)
Local oXMLHTTP, oADODBStream, lOk:=.f.
oXMLHTTP := CREATEOBJECT( "Microsoft.XMLHTTP" )
oADODBStream := CREATEOBJECT( "Adodb.Stream" )
oXMLHTTP:Open( "GET", cLink, .f. )
oXMLHTTP:Send()
If oXMLHTTP:Status() == 200
oADODBStream:Type := 1
oADODBStream:Open()
oADODBStream:Write( oXMLHTTP:ResponseBody )
oADODBStream:SaveToFile( cDest, 2 )
// MsgAlert("Download feito, ok", "Aviso")
lOk:=.t.
Else
// MsgAlert("Erro com download", "Aviso")
lOk:=.f.
Endif
Return lOk
Gracias System. Seguiré buscando.
Saludos.