Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ftp class and
Message
From
21/11/2006 16:49:13
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01171019
Message ID:
01171583
Views:
8
I am not sure what happen so I may have sent an incomplete response. FWIW here is my code where lcCmd1 is quote site fixrefm or quote site fixrecfm.
SET PROCEDURE TO ftp.prg ADDITIVE

#INCLUDE FTP.H

loFTP = CREATEOBJECT('ftp_service')

IF loFTP.OpenInternet(lcUser,lcPass,lcNode, "21")

    && connect to FTP Server (user, password, server, port)
    lcMsg = 'Connect user ' + lcUser + ' on ' + lcNode 
    =WAITSIM(lcMsg)
	=loFTP.FtpCommand("SITE HELP",  FTP_TRANSFER_TYPE_ASCII,0,.NULL.)
  	lcMsg = ALLTRIM(STR(loFTP.GetExtendedErrorCode())) + ' ' + ;
  			ALLTRIM(loFTP.GetExtendedErrorMsg())
	=WAITSIM(lcMsg,gnMsgWait)		

	&& recfn and if it exist the lrecl command
	llAllocResult	= loFTP.FtpCommand(lcCmd1, FTP_TRANSFER_TYPE_ASCII,0,.NULL.)

    IF llAllocResult 

    	lcMsg = 'Executed ' + lcCmd1 + ' command'
		=WAITSIM(lcMsg,gnMsgWait)

	    llPutResult = loFTP.PutFTPFile( lcRFile , lcLFile , lnFTPMode )
	
	    IF llPutResult
	
	    	lcMsg = "File " + lcLFile + " uploaded as " + lcRFile
			=WAITSIM(lcMsg,gnMsgWait)

	    ELSE

	    	lcMsg =  ALLTRIM(STR(loFTP.GetExtendedErrorCode())) + ;
		    	' ' + ALLTRIM(loFTP.GetExtendedErrorMsg())
			=WAITSIM(lcMsg,gnMsgWait)
			                
	    	lcMsg = 'Could not upload file ' + lcLFile + ' as ' + lcRFile
			=WAITSIM(lcMsg,gnMsgWait)

	    ENDIF           
    ELSE

	    	lcMsg =  ALLTRIM(STR(loFTP.GetExtendedErrorCode())) + ;
		    	' ' + ALLTRIM(loFTP.GetExtendedErrorMsg())
			=WAITSIM(lcMsg,gnMsgWait)
			RETURN .F.
			
    ENDIF        	
>>>>Thanks for response. The problem is that I also get the error
>>>>
501 unrecognized SITE command
>>>
>>>Maybe it's case sensitive?
>>>
>>>>I thought that "quote" just passed on the rest of the command, i.e. site .....
>>>
>>>That exactly what it does in the FTP client you're using.
>>
>>I am using FTP Class 202 which I got from the Universal thread.
>
>Not when you use 'quote' command.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform