Hi,
any example of ftp upload/download ?
thank you
***************************************
** Descargar archivo desde la web
function Descargar(cUrl,cDestino)
LOCAL nRet
DELETEURLCACHEENTRY( cUrl )
nRet := DOWNLOADFILE( cUrl, cDestino)
RETURN nRet = 0
#pragma BEGINDUMP
#include <Windows.h>
#include <hbapi.h>
#include <urlmon.h>
HB_FUNC( DOWNLOADFILE )
{
HRESULT hr;
hr = URLDownloadToFile( NULL, hb_parc( 1 ), hb_parc( 2 ), 0, NULL ) ;
hb_retnl( hr ) ;
}
#pragma ENDDUMP
DLL STATIC FUNCTION DELETEURLCACHEENTRY( cUrl AS LPSTR ) AS BOOL;
PASCAL FROM "DeleteUrlCacheEntryA" LIB "wininet.dll"
*****************************************
*** Conectar al servidor FTP
FUNCTION ConectaServerFTP(cNomSer,cNomUsr,cClaUsr,oFtp) //oFtp pasar por referencia
LOCAL cServer, cUser, cPassword, oUrl, cUrl
cServer := cNomSer
cUser := cNomUsr
cPassword := cClaUsr
cUrl := "ftp://" + cUser + ":" + cPassword + "@" + cServer
cUser:= strtran(cUser,"@","&at;")
oUrl := tUrl():New( cUrl )
IF At( "@", cUser ) > 0
oUrl:cUserID := strtran(cUser,"&at;","@")
oUrl:cPassword := cPassword
ENDIF
oFTP := tIPClientFtp():New( oUrl, .T. )
oFTP:nConnTimeout := 20000
oFTP:bUsePasv := .T.
oFtp:bTrace := {|| .t.}
oFTP:Open( )
IF oFtp <> NIL
RETURN .T.
ENDIF
RETURN .F.
******************************************************************************
FUNCTION SubeArchivoFtp(cFileOri,cFileDes,oFtp)
oFtp:Dele( cFileDes )
oFtp:UpLoadFile( cFileOri, cFileDes )
RETURN .T.
Turbo Incremental Link 6.70 Copyright (c) 1997-2014 Embarcadero Technologies, Inc.
Error: Unresolved external 'URLDownloadToFileA' referenced from C:\FWH1701\SAMPLES\FTP2.OBJ
Error: Unable to perform link
* Linking errors *
santidedos wrote:Quise compilar el módulo pero me tira el siguiente error
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 87 guests