ph_itcexecuteftp PowerHome formula function
Description
Executes an FTP request in the specified Internet Transfer Control.
Syntax
ph_itcexecuteftp ( n, s, s, n )
Argument Description
n A number from 1 to 10 representing the ITC you wish to execute an FTP request.
s A string representing the FTP operation. See Usage below.
s The ID of a macro to be executed when the operation completes.
n The request timout in seconds. Use 0 for infinity.
Return value
Integer. Returns a 0 if successful. If the specified ITC has not been created, then 1 is returned. 2 is returned if the specified ITC is outside of the range of 1 to 10. 3 is returned if the ITC is currently busy. 4 is returned if a runtime error occurs.
Usage
This function call is asynchronous. When an FTP request is made, this function returns immediately and the request is processed in the background. When the operation is complete, the specified Macro will then be executed. When the macro is executed, it will have a complete copy of LOCAL and TEMP variables that were assigned when the function was executed. However, the [TEMP1] variable will contain the response code. A value of 10 means that the control has disconnected. A value of 11 means that an error occurred. A value of 12 means that the request completed successfully. If an error occurs (response code 11 in [TEMP1]), then the error code will be in the [TEMP2] variable and the error info will be in the [TEMP3] variable. The FTP operation is contained within a single string with multiple parameters separated by a space. Below is a list of valid parameters:

Operation Description
CD file1 Change Directory. Changes to the directory specified in file1.
CDUP Change to parent directory. Equivalent to "CD.."
CLOSE Closes the current FTP connection.
DELETE file1 Deletes the file specified in file1.
DIR file1 Directory. Searches the directory specified in file1. (Wildcards are permitted but the remote host dictates the syntax.) If no file1 is specified, a full directory of the current working directory is returned.

Use ph_itcgetdata or ph_itcsavedata to access the returned data.
GET file1 file2 Retrieves the remote file specified in file1, and creates a new local file specified in file2.
LS file1 List. Searches the directory specified in file1. (Wildcards are permitted but the remote host dictates the syntax.)

Use ph_itcgetdata or ph_itcsavedata to access the returned data.
MKDIR file1 Make Directory. Creates a directory as specified in file1. Success is dependent on user privileges on the remote host.
PUT file1 file2 Copies a local file specified in file1 to the remote host specified in file2.
PWD Print Working Directory. Returns the current directory name.

Use ph_itcgetdata or ph_itcsavedata to access the returned data.
QUIT Terminates the current user.
RECV file1 file2 Retrieves the remote file specified in file1, and creates a new local file specified in file2. Equivalent to GET.
RENAME file1 file2 Renames the remote file named in file1 to the new name specified in file2. Success is dependent on user privileges on the remote host.
RMDIR file1 Remove Directory. Removes the remote directory specified in file1. Success is dependent on user privileges on the remote host.
SEND file1 file2 Copies a local file, specified in file1, to the remote host, specified in file2. Equivalent to PUT.
SIZE file1 Returns the size of the directory specified in file1.