is there a function to take one file ( csv) from a website ?
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
is there a function to take one file ( csv) from a website ?
FUNCTION MAIN()
LOCAL cFile := "ciao_silvio.csv"
GETURL( "http://www.ipsys.it" , cFile )
RETURN NIL
FUNCTION GETURL( cUrl , cFile )
LOCAL oUrl, oCli
LOCAL lOk := .F.
BEGIN SEQUENCE
oUrl = TUrl():New( cUrl + "/" + cFile )
IF EMPTY( oUrl )
BREAK
ENDIF
oCli = TIPClientHttp():New( oUrl )
IF EMPTY( oCli )
BREAK
ENDIF
IF !oCli:Open( oUrl )
BREAK
ENDIF
cStringa := oCli:Read()
oCli:Close()
END SEQUENCE
creafile( cFile , cStringa )
RETURN lOk
FUNCTION Creafile( cFile, cStringa )
LOCAL nHandle := FCreate( cFile )
LOCAL cLeggiTest
LOCAL lRitorna
IF FError() <> 0
RETURN .F.
ENDIF
FWrite( nHandle, cStringa, Len(cStringa) )
FClose( nHandle )
cLeggiTest := MEMOREAD( cFile )
lRitorna := ( FError() == 0 ) .AND. ( cStringa = cLeggiTest )
RETURN lRitornasorry but
[1]:iLink32.Exe -Gn -aa -Tpe -s @test.bcl
Turbo Incremental Link 5.69 Copyright (c) 1997-2005 Borland
Error: Unresolved external '_HB_FUN_TURL' referenced from C:\WORK\ERRORI\CVS\OBJ\TEST.OBJ
Error: Unresolved external '_HB_FUN_TIPCLIENTHTTP' referenced from C:\WORK\ERRORI\CVS\OBJ\TEST.OBJ
I insert tip.lib as Emg sad but I try to load a file and it not run
FUNCTION Main()
LOCAL cFile := "estrazionidellotto.csv"
GETURL( "http://www.estrazionidellotto.com" , cFile )
return nil
cstringa is empty I not Know why
Maybe a firewall issue?
URLDownloadToFile(0,"http://www.test.com/test.csv","c:\download\test.csv",0,0)
DLL Function URLDownloadToFile(pCaller AS LONG, szURL AS STRING, szFileName AS STRING, dwReserved AS LONG, lpfnCB AS LONG) AS LONG PASCAL FROM "URLDownloadToFileA" LIB "urlmon.dll"Regards,
Michel D.
Genk (Belgium)
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773
good this run ok on w7
Is it about my suggestion you say it's ok in W7?
It runs fine in Windows XP, Vista en 8 too.
Regards,
Michel D.
Genk (Belgium)
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773