Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FTP through wwIPStuff ends too soon
Message
De
03/11/1999 17:05:00
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Titre:
FTP through wwIPStuff ends too soon
Divers
Thread ID:
00286512
Message ID:
00286512
Vues:
82
The following problem has appeared today in some of my VFP 6.0 code which FTPs DBFs from a client's Unix server. I was hoping someone could tell me if this is a known problem with wwIPStuff or if I should look elsewhere (my network, client's network, etc) to find the source of the problem. I do have to use special software called Secure Remote to gain access to the client's network through their firewall.

Problem:
Using wwIPStuff to FTP files, the FTP ends without an error (displays "Transfer complete") before the file is fully transferred. If MS-DOS FTP is used to retrieve the same files, the files are received in full. The problem is intermittent. The wwIPStuff FTP has worked fine for the past two days, yet today failed with this problem multiple times. Also, it will fail on some files, yet fully transfer others.

Code:
Function FTP
Parameter lcFTPSite, lcUserID, lcPasswd, lcRemFile, lcLocFile, llDLoad

SET PROCEDURE TO wwUtils ADDITIVE
SET CLASSLIB TO wwIPStuff ADDITIVE

PUBLIC loFTP
loFTP=CREATE("myFTP")
Wait Window Nowait "FTP: Connecting to " + lcFTPSite + "..."

If loFTP.FTPConnect(lcFTPSite, lcUserID, lcPasswd) # 0
	Wait Window "FTP ERROR: " + loFTP.cErrorMsg
	Return .F.
Else
	Wait Window Nowait "Connection established."
EndIf

On Key Label ALT-X loFTP.lCancelDownload = .T.
If llDLoad
	Wait Window Nowait "     Downloading file " + lcRemFile + " to file " + lcLocFile
	If loFTP.FtpGetFileEx(lcRemFile, lcLocFile) # 0
		Wait Window "FTP ERROR: " + loFTP.cErrorMsg
		llRetVal = .F.
	Else
		Wait Window Nowait "Transfer complete."
		llRetVal = .T.
	EndIf
Else
	Wait Window Nowait "Uploading file " + lcLocFile + " to file " + lcRemFile
	If loFTP.FtpSendFileEx(lcLocFile, lcRemFile) # 0
		Wait Window "FTP ERROR: " + loFTP.cErrorMsg
		llRetVal = .F.
	Else
		Wait Window Nowait "Transfer complete."
		llRetVal = .T.
	EndIf
EndIf

On Key Label ALT-X
Return llRetVal


Define class myFtp as wwFTP
 
Function OnFTPBufferUpdate
LParameter lnBytesDownloaded,lnBufferReads,lcCurrentChunk
 
Do Case
	CASE lnBufferReads > 0
		Wait Window "Transferred: " + TRANSFORM(lnBytesDownloaded)+ " bytes (Alt-X to abort)" NoWait
	CASE lnBufferReads = -1
		Wait Window "Transfer ended." timeout 2
EndCase
Return

ENDDEFINE
Melissa Danforth
Customsoft Corporation
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform