Descarga desde https SOLUCIONADO

Re: Descarga desde https

Postby FranciscoA » Tue Sep 03, 2019 8:12 pm

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.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2159
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Previous

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 52 guests