error on download

Post Reply
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

error on download

Post by Silvio.Falconi »

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

#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

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
 
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
FranciscoA
Posts: 1964
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: error on download

Post by FranciscoA »

Silvio.
Intenta activando -> Usa SSL 3.0

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

Fwxh1204-MySql-TMySql
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: error on download

Post by karinha »

Simples...

Code: Select all

#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
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: error on download

Post by Silvio.Falconi »

karinha wrote:Simples...

Code: Select all

#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
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: error on download

Post by karinha »

CALLDLL()? No funciona?
João Santos - São Paulo - Brasil
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: error on download

Post by karinha »

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

Code: Select all

#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
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: error on download

Post by karinha »

João Santos - São Paulo - Brasil
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: error on download

Post by Silvio.Falconi »

NOW PERHAPS i RESOLVED .
on Windows Seven of work run ok
on Windows seven Home not run
on Windows 10 tablet I must also tested
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Post Reply