FTP Directory and File Handling

FTP Directory and File Handling

Postby don lowenstein » Wed Jun 22, 2011 11:12 pm

I am not having luck with the Fivewin / xHarbour FTP classes.

I successfully attach to the my FTP site using the sample programs as a guide. Steps 1 and 2 work fine. But when I try to process files and directory methods,
I run into problems.
There are files out there, for sure as I see and manipulate via Explorer.


1. oInternet := TInternet():New()
2. oFTP := TFTP():New( cFTPSite, oInternet, userid, passwd )
3. aFiles = oFTP:Directory( "*.*" )
aFiles[1][1] " "
aFiles[1][2] 0
aFiles[1][3] 01/01/01
aFiles[1][4] "00:00:00"

If I look for specific file which I know is there, I get the same result.


Simiar problems using the TFtpFile class also result in no bytes to be transfered.

oFile = TFtpFile():New( aSource[ n ], oFTP )
oFile:OpenRead()
oFile:Read( nBufSize )

Any ideas why I can't see or use files on the FTP site?
I'm using FWH 10.1 with xHarbour 1.2 and Borland BCC 5.5

Thank you in advance for any hints.
Don Lowenstein
www.laapc.com
User avatar
don lowenstein
 
Posts: 197
Joined: Mon Oct 17, 2005 9:09 pm

Re: FTP Directory and File Handling

Postby anserkk » Thu Jun 23, 2011 9:20 am

3. aFiles = oFTP:Directory( "*.*" )


Please check the landing path after establishing the FTP connection. You may be in a wrong path while using oFtp:Directory("*.*")

For Eg.
Code: Select all  Expand view  RUN
aFiles:=oFtp:Directory("Web/cstock/CStock.exe" )  // Be careful, it is case sensitive


I feel that it is the path problem. :)

Regards
Anser
User avatar
anserkk
 
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 82 guests