FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Ftp doubt
Posts: 332
Joined: Thu Nov 17, 2005 09:11 PM
Ftp doubt
Posted: Fri Mar 30, 2012 07:23 PM

Hi, i use aFiles = oFTP:Directory( "." ) to list all files in a ftp, but i want to change the folder before do this, how?
Thanks.

Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: Ftp doubt
Posted: Sat Mar 31, 2012 04:02 AM
To change the folder
Code (fw): Select all Collapse
oFtp:SetCurrentDirectory( cDirName )


To get the list of files in a particular folder, you can also use
Code (fw): Select all Collapse
oFtp:Directory("/myDir/MyFiles/*.*")


Regards
Anser
Posts: 332
Joined: Thu Nov 17, 2005 09:11 PM
Re: Ftp doubt
Posted: Wed May 02, 2012 11:49 AM

Thanks Anser, but i have a big problem, i use this to connect a ftp:

oInternet := TInternet():New()
oFTP := TFTP():New( "ftp.orgfree.com", oInternet, "user", "passw" )
IF Empty( oFtp:hFtp)
MsgAlert("Não foi possível conectar ao FTP","Atenção")
Return .f.
Endif

aFiles = oFTP:Directory( "." )

In some customers runs fine and aFiles returns all files in ftp, others customers aFiles returns empty, i can't see the problem.
Can you help me?

Thanks in advance.

Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Re: Ftp doubt
Posted: Wed May 02, 2012 01:02 PM

Wanderson

As Anser suggested, you need to specify the complete path for the directory

oFtp:Directory("/myDir/MyFiles/.")

Some servers are Linux, others are windows and they will not respond without the complete path

Hth

Richard

http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 582
Joined: Fri Oct 07, 2005 02:17 PM
Re: Ftp doubt
Posted: Wed May 02, 2012 06:29 PM

Wanderson

I have a same problem, the problem is "FTP Passive Mode", this mode not return list

Yo tengo el mismo problema con algunos FTPs y es porque estos necesitan conectarse con "Passive mode" y este modo no retorna nada cuando usamos "oFTP:Directory", por ahi creo que esta el problema

Enrrique Vertiz Pitta

Lima-Peru

xHb 1.23.1026X, Fwh 25.01, BCC74, MySQL 8.0.X, SQLLIB 1.9m
Posts: 332
Joined: Thu Nov 17, 2005 09:11 PM
Re: Ftp doubt
Posted: Wed May 02, 2012 06:42 PM
Richard Chidiak wrote:Wanderson

As Anser suggested, you need to specify the complete path for the directory

oFtp:Directory("/myDir/MyFiles/*.*")

Some servers are Linux, others are windows and they will not respond without the complete path

Hth

Richard


Richard thanks for your answer but the ftp server is the same, i just use ftp.orgfree.com. In somes costumers returns a complete array with files and others costumers don't.
I have no idea about this.

Thanks.

Continue the discussion