Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help With FTP

Status
Not open for further replies.

AidenMc

Programmer
Sep 19, 2002
58
GB
Hi all,
I am having a problem trying to download a file from a specfic ftp address via visual foxpro ( Ver 6 ).
I am using FtpGetFile.
I have no problem connecting to the ftp site, it's just when I connect I am at the root and the file I need lies in a dir /usr6/customs/manifest and no matter what way I call the function FtpGetFile, it cannot download the file.
I have search through the FAQ's and found some helpfull tips etc... but I can't get this to work.
Has anyone every got this before and if so how did you resolve it
thanks in advance

Aiden
 
Aiden

Here is what I use. The path to our FTP server is:
<root>/cdr

Code:
lcRemotePath  = ALLTRIM(this.origpath ) && "/cdr/"
	lcLocalPath  = "C:\temp\"
	Dimension arr [1, 5]
	nfiles = This.remoteDir2array (hFtpSession, lcRemotePath, lcMask, @arr)
	nHowMany  =ALEN(arr,1)
	Store 0 To This.nRemoteItemCount
	Store 0 To nDirCount
	For ii = 1 To nHowMany
		If arr[ii, 3] = .F.  &&... fileType = .T., File, else Dir
			This.nRemoteItemCount = This.nRemoteItemCount + 1
			Store '' To cTmpStr
			cTmpStr = '<' + arr [ii, 5] + '>'    &&... name
			nDirCount = nDirCount + 1
		Endif
	Endfor


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top