http://forums.fivetechsupport.com/viewtopic.php?f=6&t=20501&p=108900&hilit=DOWNLOADFILE#p108900
Regards.
via ftp : ok perfect ,,,
// Wininet constants
#define INTERNET_OPEN_TYPE_PRECONFIG Â Â Â Â Â Â Â Â Â Â 0
#define INTERNET_OPEN_TYPE_DIRECT Â Â Â Â Â Â Â Â Â Â Â 1
#define INTERNET_OPEN_TYPE_PROXY Â Â Â Â Â Â Â Â Â Â Â Â 3
#define INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY Â 4
#define INTERNET_INVALID_PORT_NUMBER Â Â 0
#define INTERNET_DEFAULT_FTP_PORT Â Â Â 21
#define INTERNET_DEFAULT_GOPHER_PORT Â Â 70
#define INTERNET_DEFAULT_HTTP_PORT Â Â Â 80
#define INTERNET_DEFAULT_HTTPS_PORT Â Â 443
#define INTERNET_DEFAULT_SOCKS_PORT Â Â 1080
#define INTERNET_SERVICE_FTP Â Â 1
#define INTERNET_SERVICE_GOPHER Â 2
#define INTERNET_SERVICE_HTTP Â Â 3
#define INTERNET_FLAG_TRANSFER_ASCII Â 1
#define INTERNET_FLAG_TRANSFER_BINARY 2
#define MODE Â 2
#define INTERNET_FLAG_ACTIVE Â 0
#define INTERNET_FLAG_PASSIVE 134217728
#define FILE_ATTRIBUTE_ARCHIVE 128
// FTPGETFILE( hConnect, cRemotePath + "/" + alltrim( cFileName ),"c:\temp\autoexec.bat", 0, FILE_ATTRIBUTE_ARCHIVE, 0, 0 )
//**********************************************************************
FUNCTION FTPWRITEFILE( cServerName, cLocalPath, cRemotePath, cUserName, cPassword, cFileName )
  LOCAL hInternet, hConnect
  LOCAL lOk
  IF !FILE(cLocalPath + alltrim(cFileName))
    MYMEN("Error. Archivo no existe : "+cLocalPath + alltrim(cFileName))
    RETURN .F.
  ENDIF
  hInternet = INTERNETOPEN( "Anystring", INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0 )
  hConnect = INTERNETCONNECT( hInternet, cServerName, INTERNET_DEFAULT_FTP_PORT, cUserName, cPassword, INTERNET_SERVICE_FTP, MODE, 0 )
  lOk = FTPPUTFILE( hConnect, cLocalPath +  alltrim(cFileName), cRemotePath +  alltrim( cFileName ), 0, 0 )
  IF lOk
    msgwait(hb_oemtoansi("La transferencia v¡a FTP, fue exitosa"),"Aviso informativo",10 )
  ELSE
    msgwait(hb_oemtoansi("La transferencia v¡a FTP, fue fallida"),"Aviso informativo",10 )
  ENDIF
  INTERNETCLOSEHANDLE( hConnect )
  INTERNETCLOSEHANDLE( hInternet )
  RETURN lOk
//***************************************************************
#pragma BEGINDUMP
  #include "windows.h"
  #include "wininet.h"
  #include "hbapi.h"
  HB_FUNC( INTERNETOPEN )
  {
    hb_retnl( ( LONG ) InternetOpen( hb_parc( 1 ), hb_parnl( 2 ), hb_parc( 3 ), hb_parc( 4 ), hb_parnl( 5 ) ) );
  }
  HB_FUNC( INTERNETCLOSEHANDLE )
  {
    hb_retl( InternetCloseHandle( ( HINTERNET ) hb_parnl( 1 ) ) );
  }
  HB_FUNC( INTERNETCONNECT )
  {
    hb_retnl( ( LONG ) InternetConnect( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ), ( INTERNET_PORT ) hb_parnl( 3 ), hb_parc( 4 ), hb_parc( 5 ), hb_parnl( 6 ), hb_parnl( 7 ), hb_parnl( 8 ) ) );
  }
  HB_FUNC( FTPPUTFILE )
  {
    hb_retl( FtpPutFile( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ), hb_parc( 3 ), hb_parnl( 4 ), hb_parnl( 5 ) ) );
  }
  HB_FUNC( FTPGETFILE )
  {
    hb_retl( FtpGetFile( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ), hb_parc( 3 ), hb_parl( 4 ), hb_parnl( 5 ), hb_parnl( 6 ), hb_parnl( 7 ) ) );
  }
#pragma ENDDUMP
//*******************************************************
sorry Uwe I saw now your message
the tupdate class here run ok perhaps there is a protection on your website ?
do you have CLASS TFTP ?
Silvio,
NO nothing special or protection
From inside the Forum there is no problem to download a file.
There is nothing else I need.
With the FWH-sample ( defined above ) I can open the homepage and check the directory.
Maybe I have to check the solution from Stephan again
regards
Uwe ![]()
I use the borland compiler and I include
c:\borland\bcc55\lib\psdk\urlmon.lib
regards
Massimo
Hello Massimo,
could you publish your make or batch file to compile your simple ?
Best regards,
TEST.EXE : Â Â TEST.obj
    C:\BORLAND\BCC55\bin\ilink32 -Gn -aa -Tpe -s -LC:\BORLAND\BCC55\lib @TEST.bc
TEST.c : Â TEST.prg
    C:\HARBOUR\BIN\HARBOUR TEST /n /w /p /IC:\HARBOUR\INCLUDE;C:\FWH\INCLUDE /DNORMAL
TEST.obj : Â TEST.c
    C:\BORLAND\BCC55\BIN\BCC32 -M -c /IC:\HARBOUR\INCLUDE;C:\BORLAND\BCC55\INCLUDE;C:\FWH\INCLUDE TEST.cC:\BORLAND\BCC55\lib\c0w32.obj +
TEST.obj, +
TEST.EXE, +
TEST.MAP, +
C:\FWH\lib\FiveH.lib +
C:\FWH\lib\FiveHC.lib +
c:\harbour\lib\rtl.lib +
c:\harbour\lib\vm.lib +
c:\harbour\lib\gtgui.lib +
c:\harbour\lib\lang.lib +
c:\harbour\lib\macro.lib +
c:\harbour\lib\rdd.lib +
c:\harbour\lib\dbfntx.lib +
c:\harbour\lib\dbfcdx.lib +
c:\harbour\lib\dbffpt.lib +
c:\harbour\lib\hbsix.lib +
c:\harbour\lib\debug.lib +
c:\harbour\lib\common.lib +
c:\harbour\lib\codepage.lib +
c:\borland\bcc55\lib\cw32.lib +
c:\borland\bcc55\lib\import32.lib +
c:\borland\bcc55\lib\psdk\odbc32.lib +
c:\borland\bcc55\lib\psdk\nddeapi.lib +
c:\borland\bcc55\lib\psdk\iphlpapi.lib +
c:\borland\bcc55\lib\psdk\rasapi32.lib +
c:\borland\bcc55\lib\psdk\urlmon.lib +
c:\borland\bcc55\lib\inet.libMAKE Version 5.2 Copyright (c) 1987, 2000 Borland
echo -c -tWM -D__HARBOUR__ -DHB_API_MACROS > tmp
echo -Ic:\develop\harbour\include;c:\develop\fwh\include >> tmp
c:\develop\borland\bcc55\bin\bcc32 -oobj\TestDownload @tmp TestDownload.
c
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
TestDownload.c:
Error E2238 c:\develop\harbour\include\clipdefs.h 80: Multiple declaration for ' WORD'
Error E2344 c:\Develop\Borland\Bcc55\include\windef.h 145: Earlier declaration of 'WORD'
Error E2238 c:\develop\harbour\include\clipdefs.h 82: Multiple declaration for ' PWORD'
Error E2344 c:\Develop\Borland\Bcc55\include\windef.h 154: Earlier declaration of 'PWORD'
Error E2238 c:\develop\harbour\include\clipdefs.h 102: Multiple declaration for 'BOOL'
Error E2344 c:\Develop\Borland\Bcc55\include\windef.h 143: Earlier declaration of 'BOOL'
Error E2238 c:\develop\harbour\include\clipdefs.h 105: Multiple declaration for 'PBOOL'
Error E2344 c:\Develop\Borland\Bcc55\include\windef.h 148: Earlier declaration of 'PBOOL'
Error E2238 c:\develop\harbour\include\clipdefs.h 114: Multiple declaration for 'HANDLE'
Error E2344 c:\Develop\Borland\Bcc55\include\winnt.h 283: Earlier declaration of 'HANDLE'
*** 10 errors in Compile ***Â Â #include "fivewin.ch"
  function Main()
      LOCAL  nRet
     Â
      nRet := DOWNLOADFILE( "http://www.yoursite.it/index.html", "C:\index.html" )
     Â
      MsgStop( nRet )
  RETURN NIL
  #pragma BEGINDUMP
  #include <WinTen.h>
  #include <Windows.h>
  #include <ClipApi.h>
  #include <urlmon.h>
  HB_FUNC( DOWNLOADFILE )
  {
      unsigned long  lRet ;
     Â
      lRet = URLDownloadToFile( NULL, _parc( 1 ), _parc( 2 ), 0, NULL ) ;
     Â
      _retnl( lRet ) ;
  }
  #pragma ENDDUMPHi Massimo,
thanks for your help, but the same result.
Regards
#include "fivewin.ch"
  function Main()
      LOCAL  nRet
     Â
      nRet := DOWNLOADFILE( "http://www.yoursite.it/index.html", "C:\index.html" )
     Â
      MsgStop( nRet )
  RETURN NIL
  #pragma BEGINDUMP
  #define _CLIPDEFS_H
  #include <WinTen.h>
  #include <Windows.h>
  #include <ClipApi.h>
  #include <urlmon.h>
  HB_FUNC( DOWNLOADFILE )
  {
      unsigned long  lRet ;
     Â
      lRet = URLDownloadToFile( NULL, _parc( 1 ), _parc( 2 ), 0, NULL ) ;
     Â
      _retnl( lRet ) ;
  }
  #pragma ENDDUMP#include "fivewin.ch"
function Main()
LOCAL nRet
nRet := DOWNLOADFILE( "http://www.yoursite.it/index.html", "C:\index.html" )
MsgStop( nRet )
RETURN NIL
#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 ENDDUMPDear Antonio,
where do we find:
URLDownloadToFile
Is this only for Harbour.
Best regards,
Otto