FTP-directory

FTP-directory

Postby Dietmar Jahnel » Fri Aug 10, 2007 2: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
User avatar
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria

Postby Antonio Linares » Fri Aug 10, 2007 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42103
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Dietmar Jahnel » 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
User avatar
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42103
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Dietmar Jahnel » Mon Aug 13, 2007 2:45 pm

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

Dietmar
User avatar
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria

Postby Antonio Linares » Mon Aug 13, 2007 4: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42103
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Dietmar Jahnel » Mon Aug 13, 2007 6: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...
User avatar
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria

Postby Antonio Linares » 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
Last edited by Antonio Linares on Tue Aug 14, 2007 8:08 am, edited 1 time in total.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42103
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby James Bott » 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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Dietmar Jahnel » Tue Aug 14, 2007 6:50 am

Antonio,

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

Thank,
Dietmar
User avatar
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria

Postby Antonio Linares » Tue Aug 14, 2007 8:10 am

James,

Please try it with FWH 7.07, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42103
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Tue Aug 14, 2007 8:39 am

Dietmar,

Solved. Try it this way:
Code: Select all  Expand view  RUN
#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
User avatar
Antonio Linares
Site Admin
 
Posts: 42103
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Dietmar Jahnel » Tue Aug 14, 2007 9:42 am

now it' working fine!

many thanks!
User avatar
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria

Postby Antonio Linares » Tue Aug 14, 2007 9:50 am

glad to know its fine :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42103
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Dietmar Jahnel » 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:

Code: Select all  Expand view  RUN
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
User avatar
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 84 guests