error on download

error on download

Postby Silvio.Falconi » Mon Oct 05, 2020 4:55 pm

To download a file from Internet I used this function URLDownloadToFileA

Now the file not is downloaded

I'm using Windows Seven Home Premium or Windows 10 Home

If I test the url where I must download the file it run ok , I can download the file but from fivrewin I have problems what's happened ?

the test
Code: Select all  Expand view
#include "FiveWin.ch"
#include "xBrowse.ch"
#include "constant.ch"

REQUEST DBFCDX
REQUEST DBFFPT
EXTERNAL ORDKEYNO,ORDKEYCOUNT,ORDCREATE,ORDKEYGOTO
//---------------------------------------------------------------//


#define URL_LOTTO "https://www.lottomatica.it/STORICO_ESTRAZIONI_LOTTO/storico.zip"

Function test()
Local cPath:=".\dat\"
DescargFichDesdeUrl(cPath)
return nil


Static Function DescargFichDesdeUrl(cPath)
   local cZipFile := cPath+"
storico_"+DtoS(Date())+".zip"
   local cUrl  := URL_LOTTO

    DELETEURLCACHEENTRY( cUrl )
    ? cZipFile
    URLDOWNLOADTOFILE( 0, cUrl, cZipFile )

RETURN NIL

DLL STATIC FUNCTION DELETEURLCACHEENTRY( cUrl AS LPSTR ) AS BOOL;
    PASCAL FROM "
DeleteUrlCacheEntryA" LIB "wininet.dll"

DLL FUNCTION URLDOWNLOADTOFILE( pCaller AS LONG, cUrl AS LPSTR, cFileName AS LPSTR, nReserved AS DWORD, nFnCB AS LONG ) AS LONG;
    PASCAL FROM "
URLDownloadToFileA" LIB "urlmon.dll"


I allready check the tls option

Image

trying this evening on windows seven premium give me this error on compilation
Code: Select all  Expand view
Progetto: test, Ambiente: bcc7Harbor:
[1]:Harbour.Exe test.prg  /m /n0 /gc1 /es2 /a /iC:\Work\fwh\include /iC:\work\HARBOUR\Include /jI18n\Main.hil /iinclude;c:\work\fwh\include;C:\work\HARBOUR\include /oObj\test.c
Harbour 3.2.0dev (r1904111533)
Copyright (c) 1999-2019, https://harbour.github.io/
Compiling 'test.prg'...
Lines 4980, Functions/Procedures 2
Generating C source output to 'Obj\test.c'... Done.
[1]:Bcc32.Exe -M -c -DHB_OS_WIN_32 -DHB_FM_STATISTICS_OFF -DHB_NO_DEFAULT_API_MACROS -DHB_NO_DEFAULT_STACK_MACROS -IC:\Work\fwh\include -IC:\work\bcc7\Include\windows\sdk\;C:\work\HARBOUR\Include  -nObj Obj\test.c
Embarcadero C++ 7.30 for Win32 Copyright (c) 1993-2017 Embarcadero Technologies, Inc.
Obj\test.c:
[1]:iLink32.Exe -Gn -aa -Tpe -s -v @test.bcl
Turbo Incremental Link 6.80 Copyright (c) 1997-2017 Embarcadero Technologies, Inc.
Error: Unresolved external 'URLDownloadToFileA' referenced from C:\WORK\ERRORI\DOWNLOAD\OBJ\TEST.OBJ
Error: Unable to perform link
 
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7048
Joined: Thu Oct 18, 2012 7:17 pm

Re: error on download

Postby FranciscoA » Mon Oct 05, 2020 6:21 pm

Silvio.
Intenta activando -> Usa SSL 3.0

Saludos
Francisco J. Alegría P.
Chinandega, Nicaragua.

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

Re: error on download

Postby karinha » Mon Oct 05, 2020 8:16 pm

Simples...

Code: Select all  Expand view

#Include "FiveWin.ch"

#Define URL_LOTTO "https://www.lottomatica.it/STORICO_ESTRAZIONI_LOTTO/storico.zip"

FUNCTION Silvio_DownLoad()

   LOCAL cUrl := ALLTRIM( URL_LOTTO )

   Download_Silvio( cUrl )

RETURN NIL

FUNCTION Download_Silvio( cUrl )

   cUrl := IF( "@" $ cUrl, "mailto:" + cUrl, cUrl )

   // ? cUrl

   IF Empty( cUrl )

      MsgInfo( "Introduza Uma URL Correta", "Atencion" )

   ELSE

      CURSORWAIT()

      IF IsWinNT() .OR. isWin2000() // XP/2000/NT

         WinExec( "rundll32.exe url.dll, FileProtocolHandler " + cUrl, 0 )

      ELSE

         WinExec( "Start " + cUrl, 0 )

      ENDIF

      CURSORARROW()

   ENDIF

RETURN NIL

// fin - By: kapiabafwh@gmail.com
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7804
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: error on download

Postby Silvio.Falconi » Tue Oct 06, 2020 9:17 am

karinha wrote:Simples...

Code: Select all  Expand view

#Include "FiveWin.ch"

#Define URL_LOTTO "https://www.lottomatica.it/STORICO_ESTRAZIONI_LOTTO/storico.zip"

FUNCTION Silvio_DownLoad()

   LOCAL cUrl := ALLTRIM( URL_LOTTO )

   Download_Silvio( cUrl )

RETURN NIL

FUNCTION Download_Silvio( cUrl )

   cUrl := IF( "@" $ cUrl, "mailto:" + cUrl, cUrl )

   // ? cUrl

   IF Empty( cUrl )

      MsgInfo( "Introduza Uma URL Correta", "Atencion" )

   ELSE

      CURSORWAIT()

      IF IsWinNT() .OR. isWin2000() // XP/2000/NT

         WinExec( "rundll32.exe url.dll, FileProtocolHandler " + cUrl, 0 )

      ELSE

         WinExec( "Start " + cUrl, 0 )

      ENDIF

      CURSORARROW()

   ENDIF

RETURN NIL

// fin - By: kapiabafwh@gmail.com
 


Regards, saludos.


yes of cource this run ok
BUT I wish not show the link where I download it
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7048
Joined: Thu Oct 18, 2012 7:17 pm

Re: error on download

Postby karinha » Tue Oct 06, 2020 11:03 am

CALLDLL()? No funciona?
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7804
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: error on download

Postby karinha » Tue Oct 06, 2020 11:12 am

Intenta asi con Harbour, no uso. No puedo ayudar.

Code: Select all  Expand view

#include "FiveWin.ch"

FUNCTION Main()

   nHandleDLL := LoadLib32( "UrlMon.dll" )

   nStatus := hb_dynCall( { "URLDownloadToFileA", nHandleDLL,HB_DYN_CALLCONV_STDCALL},0,"http://www.bcb.gov.br/Ftp/pstaw10/leiame.txt","C:\leiame.txt",0,0)

   hb_LibFree( nHandleDLL )

RETURN NIL
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7804
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: error on download

Postby karinha » Tue Oct 06, 2020 12:37 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7804
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil


Return to FiveWin for Harbour/xHarbour

Who is online

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

cron