FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FTP-directory
Posts: 83
Joined: Mon Oct 17, 2005 10:33 AM
FTP-directory
Posted: Fri Aug 10, 2007 02:35 PM

I'm trying to read the files from a ftp-server.

I modified the ftpdir-sample and always get "oFTP:hFTP is null"
both oInternet:hWinINet and oInternet:hSession are empty

Am I doing something wrong or is it a Vista-related problem?
Many thanks for help,
Dietmar

function Main()

local oInternet := TInternet():New()
// local oFTP := TFTP():New( "207.46.133.140", oInternet ) //
local oFTP := TFTP():New( "ftp://ftp.ourserver.at/", oInternet )

local aFiles

if ! Empty( oFTP:hFTP )
aFiles = oFTP:Directory( "." )
AEval( aFiles, { | aFile | MsgInfo( aFile[ 1 ] ) } )
else
MsgAlert( "oFTP:hFTP is null" )
endif

oInternet:End()

MsgInfo( "Done!" )

return nil

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
FTP-directory
Posted: Fri Aug 10, 2007 09:06 PM

Dietmar,

Just change this line in your code and its working fine (tested on Vista):

local oFTP := TFTP():New( "ftp.microsoft.com", oInternet )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 83
Joined: Mon Oct 17, 2005 10:33 AM
FTP-directory
Posted: Mon Aug 13, 2007 12:32 PM

Antonio,

I tried this sample on two PCs - the result is always "oFTP:hFTP is null"

How can I find out what the problem is?

Thanks (again) for help,
Dietmar

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
FTP-directory
Posted: Mon Aug 13, 2007 12:58 PM

Dietmar,

Can you connect to ftp.microsoft.com from the Internet Explorer ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 83
Joined: Mon Oct 17, 2005 10:33 AM
FTP-directory
Posted: Mon Aug 13, 2007 02:45 PM

yes I can connect to ftp://ftp.microsoft.com/ from Internet Explorer.

Dietmar

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
FTP-directory
Posted: Mon Aug 13, 2007 04:55 PM

Dietmar,

Here I run Vista as Administrator, please try it as Administrator to see if that makes a difference, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 83
Joined: Mon Oct 17, 2005 10:33 AM
FTP-directory
Posted: Mon Aug 13, 2007 06:31 PM

It does not make a difference.
I tried on a PC with WindowsXP in a different environment - same result.
I built the sample with xHB RC16 and FWH 7.05

On my vistaPCs its only me with all the rights possible.

Must be something else...

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
FTP-directory
Posted: Mon Aug 13, 2007 10:32 PM

Dietmar,

I email you my EXE built using FWH 7.07 and Borland. Please try it there, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
FTP-directory
Posted: Mon Aug 13, 2007 11:06 PM

I am getting the message "oFTP:hFTP is null" here too (actually oFTP:hFTP is equal to zero). I am using FWH 7.05, Borland, and XP Pro SP2. I have administrator rights.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 83
Joined: Mon Oct 17, 2005 10:33 AM
FTP-directory
Posted: Tue Aug 14, 2007 06:50 AM

Antonio,

your exe is working here as well!
any idea how to solve the problem?

Thank,
Dietmar

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
FTP-directory
Posted: Tue Aug 14, 2007 08:10 AM

James,

Please try it with FWH 7.07, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
FTP-directory
Posted: Tue Aug 14, 2007 08:39 AM
Dietmar,

Solved. Try it this way:
#include "FiveWin.ch"

function Main() 

local oInternet := TInternet():New() 
local oFTP := TFTP():New( "ftp.microsoft.com", oInternet ) 
local aFiles 

if ! Empty( oFTP:hFTP ) 
aFiles = oFTP:Directory( "*.*" ) 
AEval( aFiles, { | aFile | MsgInfo( aFile[ 1 ] ) } ) 
else 
MsgAlert( "oFTP:hFTP is null" ) 
endif 

oInternet:End() 

MsgInfo( "Done!" ) 

return nil

DLL32 FUNCTION InternetOpen( cApp as LPSTR, n1 AS DWORD, n2 AS LPSTR, n3 AS LPSTR,;
                             n4 AS DWORD ) AS LONG PASCAL ;
                             FROM "InternetOpenA" LIB "wininet.dll"
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 83
Joined: Mon Oct 17, 2005 10:33 AM
FTP-directory
Posted: Tue Aug 14, 2007 09:42 AM

now it' working fine!

many thanks!

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
FTP-directory
Posted: Tue Aug 14, 2007 09:50 AM

glad to know its fine :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 83
Joined: Mon Oct 17, 2005 10:33 AM
FTP-directory
Posted: Tue Aug 14, 2007 10:28 AM
Sorry, but now I have another problem:

I need to read the file name and put it in a text file using:

oText := TTxtFile():New( datei )

FOR x = 1 to len(aSpringer)
   oText:Add(aSpringer[x,1])
NEXT


that' s the result:

JBl_E-2006-643-647-VfGH.pdf ÿÿÿÿ ¸ò ˜ò œò ´ò  , ò à“" ø“"  è    ØÝ ØÝ I " "\à P‘ @} N N EEEE T R O O N N N I C SS

230-N NN E T R O O N NN I C
JBl_E-2006-647-649-OGH.pdf i o n D y n a m i c F a l s e ] 3 ' &Uà ›
w™­Þ™    
  T R U S   C : \ P e wt’ t’ 
JBl_E-2006-649-653-OGH.pdf 7-144-Novÿ ûDî Ä  P‘ 09:10AM 83386 JBl-2000-145-151-Winkler.pdf
05-02-07 09:10AM 123366 JBl-2000-152-161-Taupitz.pdf
05-02-07 09:10AM 153878 JBl-2000-16-30-Schima.pdf
05-02-07 09

I found some posts about this extra informations, but no solution...
Dietmar