Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sending FTP file via FoxPro 8.0
Message
 
To
19/07/2003 18:10:27
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00800763
Message ID:
00811816
Views:
26
Wahyu

Here is the code I use to send a file. I do this from a VFP form, where I have dropped the ActiveX control on it. I name the control oFTP
	lcimmsfile=[IMMS.EI.CQIOR.IMP]+ALLT(gcSiteID)+[.OI.TXT]
	WAIT [Sending File to FTP] WINDOW NOWAIT
        ***********************************************
        * Setup the activeX Information
        ***********************************************
	THISFORM.oftp.HOSTNAME=ALLTRIM(THISFORM.frmip)
	THISFORM.oftp.UserName=ALLTRIM(THISFORM.username)
	THISFORM.oftp.PASSWORD=ALLTRIM(THISFORM.PASSWORD)
        *************************************************
        * Create the FTP Connection
        *************************************************
	success = THISFORM.oftp.CONNECT()
        *************************************************
        * Check to see if the connection was OK, if Not message and bounce Out
        *************************************************
	IF success=0
		=MESSAGEBOX("Could not connect to Tenet IMMS FTP Server",4+64+4096,"Care Tracker Enterprise",20000)
		THISFORM.oftp.savexmlLog("import.xml")
		RETURN
	ENDIF
	WAIT [Connected....] WINDOW NOWAIT
        **********************************************************
        * Change Directory on the FTP Site
        **********************************************************
	THISFORM.oftp.ChangeRemoteDir("IMMSIMPORT")
	lcFileText=''
	WAIT [Attempting to Send File....] WINDOW NOWAIT
        **********************************************************
        * Send/Put the file from the client to the FTP Site
        **********************************************************
	thisform.oftp.putFile(ALLTRIM(thisform.frmOutFile),lcImmsFile)
	WAIT CLEAR
        *********************************************************
        * Disconnect from the FTP Server
        *********************************************************
	THISFORM.oftp.Disconnect
Hope this helps.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform