FesiFTP - The low level routines
The ftp object supports the following routines specifically for use by EcmaScript. The routines may return a success flag or a value (null in case of error). In case of error check the lastError variable. The lastReply variable is filled by some routines. lastError and lastReply are reset by each call. If the exception mode is set to true, an exception is thrown and the script aborted in case of error. This allow to simplify the coding when it is known that the actions should be successful.
logMessage("text")
Log a message to the log window, without end of line. The argument must be a string (no automatic conversion). Use toString() if needed.
logMessageEol("text")
Log a message to the log window, with end of line.The argument must be a string (no automatic conversion). Use toString() if needed.
logError("text")
Show the text on an error window, requiring acknowledgement of the user.The argument must be a string (no automatic conversion). Use toString() if needed.
requestDialog("requestTitle", "requestText" [,"defaultAnswer"])
Request a string reply via a dialog box. Returns null if cancelled..
requestConnectionInfo("defaultServer", "defaultUsername", "defaultPassword")
Request the connection information with the specified defaults (which may be empty strings). Return a ConnectionInfo object, which has the properties server, username and password. Reurns null if cancelled or if the server name is blank.
addMacro("name","script")
Add the specified macro to the macro menu. Used in the startup script to install macros. The script is usually a simple function call.The maco can do anything, including loading files defining more macros.
connect("server","username","password")
Connect to the server, returning true in case of success, with some information in lastReply.
disconnect()
Disconnect from the server, returning true in case of success, with some information in lastReply.
remoteGetWorkingDirectory()
Return the remote current directory, null in case of error.
remoteChangeWorkingDirectory("newDir")
Change the remote working directory, returning the new remote current directory, null in case of error.
remoteChangeToParentDirectory()
Change the remote working directory to its parent, returning the new remote current directory, null in case of error.
remoteGetFileList()
Get the list of remote files, returning an array of FTPFile (see the ORO NetComponent documentation). The string representation of an FTPFile is the line printed by the list directory command.
remoteMakeDirectory("directory")
Make a directory at the remote site, returning true in case of success.
remoteDeleteFile("file")
Delete a remote file, returning true in case of success.
remoteRemoveDirectory()
Remove a remote directory, which must be empty. Returns true in case of success.
localGetWorkingDirectory()
Return the local current directory, null in case of error.
localChangeWorkingDirectory("newDir")
Change the local working directory, returning the new remote current directory, null in case of error.
localChangeToParentDirectory()
Change the local working directory to its parent, returning the new remote current directory, null in case of error.
localGetFileList()
Get the list local files, returning an array of FTPFile (see the ORO NetComponent documentation). The string representation of an FTPFile is the line printed by the list directory command.
localMakeDirectory("directory")
Make a directory at the local site, returning true in case of success.
localDeleteFile("file")
Delete a local file, returning true in case of success.
localRemoveDirectory()
Remove a local directory, which must be empty. Returns true in case of success.
getTextFile("localFileName"[,"remoteFileName"])
Get a text file, return true in case of success, false in case of error. remoteFileName defaults to localFileName.
getBinaryFile("localFileName"[,"remoteFileName"])
Get a binary file, return true in case of success, false in case of error. remoteFileName defaults to localFileName.
sendTextFile("localFileName"[,"remoteFileName"])
Send a text file, return true in case of success, false in case of error. remoteFileName defaults to localFileName.
sendBinaryFile("localFileName"[,"remoteFileName"])
Send a binary file, return true in case of success, false in case of error. remoteFileName defaults to localFileName.
setExceptionMode(newMode)
Seet exception mode to true (raise an exception) or false (return a status)..
getExceptionMode()
Get the current exception mode.
The FTPFile object returned by the directory commands allow access to individual elements as name, size, timestamp. See the OROINC documentation for details.

In addition the ftp object supports high level routines.


Back to main FesiFTP page 
Last update: 18 July 1998