List FTP Server Directories

Verb: ftpList

Avaliable from: <Standard>

Lists all directories that are inside the server using the FTP or SFTP protocol.

The FTP and SFTP protocols make it possible to transfer files between computers via the network.

Syntax

ftpList --type(FtpType) --host(String) [--useanonymous(Boolean)] [--useprivatekeyauthentication(Boolean)] --sftpusername(String) [--ftpusername(String)] [--password(String)] --remotepath(String) --privatekeyfile(String) (String)=value

Inputs

Script Designer Required AcceptedTypes Description
--type Type Required FtpType Type of protocol to be used:
  • Ftp
  • Sftp
  • FTP and SFTP transfer the file from one computer to another, however, FTP does not provide a secure channel for transferring files, while SFTP offers extra protection for files, for example, using the SSH (Secure Shell) security protocol.
    --host Server Path Required Text Path of the server where the file is located.
    --useanonymous Anonymous connection Optional Boolean When enabled, it hides the username, establishing an anonymous connection.
    --useprivatekeyauthentication Use private key authentication Optional Boolean When enabled, it makes the field available to inform the path of the private key file.
    --sftpusername SFTP username Only when Type is Sftp Text Username to access the server via SFTP.
    --ftpusername FTP username Optional Text Username to access the server via FTP.
    --password Password Optional Text User password to access the server via FTP.
    --remotepath Remote Path Required Text Path on the server where the directories will be listed.
    --privatekeyfile Private key file Only when Use private key authentication is True Text Path to the private key file.

    Outputs

    Script Designer AcceptedTypes Description
    value Directories Text Returns a list that contains all the directories found on the server.

    Example

    The command lists all directories contained on a server using the FTP protocol.

    defVar --name listedDirectories --type String
    ftpList --type "Ftp" --host hostAddress --username userName --password userPassword --remotepath directoryPathForList listedDirectories=value
    
    For this example to work properly, it is necessary to use a valid host, with valid username and password for access.

    See Also

  • Delete File from FTP Server
  • Download FTP Server File
  • Upload File to FTP Server