Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with FTPDeleteFile
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
West Wind Web Connection
Titre:
Problem with FTPDeleteFile
Divers
Thread ID:
01073556
Message ID:
01073556
Vues:
62
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform