Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with FTPDeleteFile
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
West Wind Web Connection
Title:
Problem with FTPDeleteFile
Miscellaneous
Thread ID:
01073556
Message ID:
01073556
Views:
63
I want to read files from a folder and delete them after. It gives me back the error "Invalid handle" after the FTPDelete (And it doesn't delete the file).
ANy clue?

I am using wwipstuff.

I am using the following code:
* get the files to the headoffice

DIMENSION laFiles[1,4]

*connect FTP server
oFTP.FTPConnect(THISFORM.sync_ftp_server,THISFORM.sync_ftp_user,THISFORM.sync_ftp_pass)

*get the files
lnResult = oFTP.aFTPDir(@laFiles,ALLTRIM(THISFORM.sync_fromheadoffice)+"/*.*")
FOR x=1 to lnResult

	*---------------------------------------------*
	* FTP du fichier du  serveur                  *
	*---------------------------------------------*
	lResult = oFTP.FTPGetFile(THISFORM.sync_ftp_server,;
	                          ALLTRIM(THISFORM.sync_fromheadoffice)+"/"+ALLTRIM(laFiles[x,1]),;
	                          "..\synchro\in\"+ALLTRIM(laFiles[x,1]),1,;
	                          THISFORM.sync_ftp_user,;
	                          THISFORM.sync_ftp_pass)
	
	IF lResult = 0
		THISFORM.Scnstatus.Value = "Retreiving "+ALLTRIM(laFiles[x,1])+"..." 
		*
		lResult = oFTP.FTPDeleteFile(ALLTRIM(THISFORM.sync_fromheadoffice)+"/"+laFiles[x,1]) 
		IF lResult != 0
			THISFORM.Scnstatus.Value = "Failed to delete"
			WAIT oFTP.cErrorMsg window
		ENDIF
	ELSE
		THISFORM.Scnstatus.Value = "Retreiving "+ALLTRIM(laFiles[x,1])+" (Failed)..." 
		WAIT "STOP2" WINDOW
		WAIT oFTP.cErrorMsg window
	ENDIF
	

	*---------------------------------------------*
	* Load back the data                          *
	*---------------------------------------------*

ENDFOR

oFTP.FTPclose()	
Eric Crespin
Consultant
PC PLUS Software Inc.
www.pcplus.ca
Next
Reply
Map
View

Click here to load this message in the networking platform