Features:
Sets or returns the file transfer mode.
object.BinMode[=Xfer As Boolean]
Boolean. Returns TRUE for binary mode; otherwise, FALSE (ASCII mode).
Read/write.
Xfer is an optional parameter that sets the file transfer to binary mode (TRUE), or to ASCII mode (FALSE).
This example sets file transfer to binary mode (TRUE).
set ftpmgr = CreateObject("ucx:FTPFileMgr")
ftpmgr.Server = "193.97.54.165"
ftpmgr.Login ("User", "password")
print (ftpmgr.binmode)
ftpmgr.BinMode = True
ftpmgr.logout()
Returns an Entry object that represents the current working directory on a remote host.
object.CurrentDir
Entry.
Read-only.
This example returns an Entry object that represents the current working directory on a remote host.
set ftpmgr = createobject("ucx:FTPFileMgr")
ftpmgr.server = "193.97.54.165"
ftpmgr.login ("User", "password")
set currentDir = ftpmgr.currentDir
print (currentDir.Name)
ftpmgr.logout()
Returns the working directory on a local machine. By default, files will be transferred to this directory.
object.LocalDir
String.
Read-only.
This example returns the working directory on a local machine.
set ftpmgr = createobject("ucx:FTPFileMgr")
ftpmgr.server = "193.97.54.165"
ftpmgr.login ("User", "password")
print (ftpmgr.localdir)
ftpmgr.logout()
Specifies the port number of the port used to connect to the FTP server.
Object.Port
Integer.
Read/Write.
By default, the port number is set to 21.
The user can specify the port number and then call Login method.
This example sets the port number to 22.
set ftpmgr = createobject("ucx:FTPFileMgr")
ftpmgr.port = 22
ftpmgr.login ("User", "password")
print (ftpmgr.localdir)
ftpmgr.logout()
Sets or returns name or IP address of the remote host.
object.Server[=Address As String]
String.
Read/write.
Address is an optional parameter that sets the IP address for the remote host.
This example sets the IP address of the remote host to 193.97.54.165.
set ftpmgr = createobject("ucx:FTPFileMgr")
ftpmgr.server = "193.97.54.165"
ftpmgr.login ("User", "password")
print (ftpmgr.localdir)
ftpmgr.logout()
Sets or returns the timeout value, in seconds, for the FTP operation.
object.TimeOut[=Seconds As Integer]
Integer.
Read/write.
Seconds is an optional parameter that sets the timeout value in seconds for the remote host (default=10).
This example sets the timeout value of the remote host to 20 seconds.
set ftpmgr = createobject("ucx:FTPFileMgr")
ftpmgr.server = "193.97.54.165"
ftpmgr.login ("User", "password")
ftpmgr.timeout=20
ftpmgr.logout()
Determines whether or not FTP operations are displayed on the current screen.
object.Verbose[=Value As Boolean]
Boolean. Returns TRUE (default) if FTP operations are displayed on the current screen (shell); otherwise FALSE.
Read/write.
Value is an optional parameter that sets the verbose value. If set to TRUE, the FTP operations are displayed on the current screen (shell).
This example causes FTP operations not to display on the current screen.
set ftpmgr = createobject("ucx:FTPFileMgr")
ftpmgr.server = "193.97.54.165"
ftpmgr.verbose = false
ftpmgr.login ("User", "password")
ftpmgr.logout()
Changes the current directory on the remote host.
object.ChangeDir(
Path As String)
Boolean. Returns TRUE if the change is successful; otherwise, FALSE.
This example changes the current directory on the remote host to the Temp directory.
set ftpmgr = createobject ("ucx:ftpfilemgr")
ftpmgr.server = "193.97.54.165"
ftpmgr.login ("User", "Password")
set currentDir = ftpmgr.currentDir
print (currentDir.Name)
ftpmgr.changeDir ("Temp")
print (ftpmgr.currentDir.Name)
ftpmgr.logout()
Changes the current directory on the local host.
object.ChangeLocalDir(
Path As String)
Boolean. Returns TRUE if the change is successful; otherwise, FALSE.
This example changes the current directory on the remote host to the Temp directory.
set ftpmgr = createobject ("ucx:ftpfilemgr")
ftpmgr.server = "193.97.54.165"
ftpmgr.login ("User", "Password")
set currentDir = ftpmgr.currentDir
print (currentDir.Name)
ftpmgr.changelocaldir ("/Temp")
print (ftpmgr.localdir)
ftpmgr.logout()
Finds an Entry object by path.
object.FindEntry(
Path As String)
Entry. Returns the Entry object that corresponds to the path.
This FindEntry example finds the file log.txt.
set ftpmgr = createobject ("ucx:ftpfilemgr")
ftpmgr.server = "193.97.54.165"
ftpmgr.login ("User", "Password")
set entry = ftpmgr.findentry ("/home/user/log.txt")
print ("File name: " &entry.name & "File Size: " &entry.size)
Logs a user in to the FTP server.
object.Login(
UserName As String,
Password As String)
Boolean. Returns TRUE if the login is successful; otherwise, FALSE.
The Server property must be set prior to calling this function.
This example logs User in to the FTP server. Notice that the Server property is set prior to calling the Login method.
set ftpmgr = createobject ("ucx:ftpfilemgr")
ftpmgr.server = "193.97.54.165"
ftpmgr.login ("User", "Password")
set currentDir = ftpmgr.currentDir
print (currentDir.Name)
ftpmgr.changelocaldir ("/Temp")
print (ftpmgr.localdir)
ftpmgr.logout()
Logs a user out of the FTP server.
object.Logout()
None.
Boolean. Returns TRUE if the logout is successful; otherwise, FALSE.
This example logs User out of the FTP server.
set ftpmgr = createobject ("ucx:ftpfilemgr")
ftpmgr.server = "193.97.54.165"
ftpmgr.login ("User", "Password")
set currentDir = ftpmgr.currentDir
print (currentDir.Name)
ftpmgr.changelocaldir ("/Temp")
print (ftpmgr.localdir)
ftpmgr.logout()