This shows you the differences between two versions of the page.
ftp_adaptor [2021/10/13 15:02] montse [Remote FTP file management functions] |
ftp_adaptor [2024/12/10 12:52] (current) montse [Functions] |
||
---|---|---|---|
Line 10: | Line 10: | ||
=====Initialization Parameters===== | =====Initialization Parameters===== | ||
- | * **Host:** Name or IP address of the FTP server we want to connect. | + | * **Host:** name or IP address of the FTP server we want to connect. |
- | * **Port:** Port number on which the FTP server listens. | + | * **Port:** port number on which the FTP server listens. |
- | * **User:** Username we want to use to make the connection. | + | * **User:** username we want to use to make the connection. |
- | * **Password:** Password of the user we want to use to make the connection. | + | * **Password:** password of the user we want to use to make the connection. |
- | * **Secure:** Checkbox that indicates whether the connection will be secure or not. | + | * **Secure:** checkbox that indicates whether the connection will be secure or not. |
=====Functions===== | =====Functions===== | ||
+ | * **connect():** it allows the connection with a new server that is not the same server as the one settled in the adaptor. In case that the old connection is still open, this function closes it. This function uses the following parameters: \\ \\ | ||
+ | *Host: IP address or name of the FTP server we want to connect. | ||
+ | *Port: port number on which the FTP server listens, if this parameter is not set the adaptor will use the default port to the protocol. | ||
+ | *User: username used to stablish the connection. | ||
+ | *Password: password of the user used to stablish the connection. | ||
+ | *Secure: indicates if the connection is secure (SFTP) or not (FTP). | ||
+ | |||
+ | * **deleteFile():** allows to delete a File on the server, it gets a parameter RemoteFilePath to indicate the path and the name of the file that the user wants to delete.\\ \\ | ||
+ | * **disconnect():** allows the disconnection from the server. This function requires no input parameters.\\ \\ | ||
+ | * **getFile():** allows to transfer a file from the server to the PC in which the diagram is executed. The parameters used are:\\ \\ | ||
+ | *RemoteFilePath: indicates the path and the name of the remote file we want to recover on the server. | ||
+ | *LocalFilePath: indicates the path and the name of the local file we want to create on the local computer. | ||
+ | *BinaryFile: indicates the type of transfer, Binary if the checkbox is clicked or text if not.\\ \\ | ||
+ | * **putFile():** allows to transfer a file from the PC to the server in which the diagram is executed. The parameters used are:\\ \\ | ||
+ | *RemoteFilePath: indicates the path and the name of the remote file we want to create on the server. | ||
+ | *LocalFilePath: indicates the path and the name of the local file we want to transfer. | ||
+ | *BinaryFile: indicates the type of transfer, Binary if the checkbox is clicked or text if not. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
- | The predefined functions provided by this adapter can be classified into several groups: | ||
- | ====Directory management functions==== | ||
- | * **createLocalDirectory:** Creates a directory on the local computer. Receives as parameters:\\ | ||
- | *DirectoryName: As a value you have to give a name to the directory to be created on the local machine.\\ \\ | ||
- | * **createRemoteDirectory:** Creates a directory in the remote FTP. Receive as parameters:\\ | ||
- | *DirectoryName: As a value you have to give a name to the directory to be created on the remote computer.\\ \\ | ||
- | * **currentLocalDirectory:** Gives you information about the local directory you are in. No parameters are required.\\ \\ | ||
- | * **currentRemoteDirectory:** Gives you information about the FTP directory you are in. No parameters are required.\\ \\ | ||
- | * **changeLocalDirectory:** Changes from the directory you are in to another directory on your local computer. Receive as input parameters:\\ | ||
- | *Directory: As value, the name of the directory we want to move to on the local computer or disk C.\\ \\ | ||
- | * **changeRemoteDirectory:** Changes from the directory you are in to another directory in the FTP. Receive as input parameter:\\ | ||
- | *Directory: As a value, the name of the directory we want to move to on the remote machine.\\ \\ | ||
- | * **deleteLocalDirectory:** Deletes a directory on your local computer. Receive as input parameters:\\ | ||
- | *DirectoryName: As value, the name of the directory to be deleted on the local computer.\\ \\ | ||
- | * **deleteRemoteDirectory:** Deletes a directory on the remote FTP. Receives as input parameters:\\ | ||
- | *DirectoryName: As a value, the name of the directory to be deleted on the remote machine. | ||
- | ====Remote FTP file management functions==== | ||
- | * **deleteFile:** Allows to delete a file from the server. It receives as parameter:\\ | ||
- | *RemoteFilePath: Specifies the path and name of the FTP file to be deleted.\\ \\ | ||
- | * **dirLocalFiles:** Displays files in the directory of the current local computer. No input parameters are required.\\ \\ | ||
- | * **dirRemoteFiles:** Displays files in the current FTP directory. No input parameters required.\\ \\ | ||
- | * **getFile:** Downloads a file from the remote FTP to the local computer where the diagram is executed. Receives as input parameters:\\ | ||
- | *RemoteFilePath: Indicates the path and name of the remote file to be downloaded. | ||
- | *LocalFilePath: Indicates the path and name of the local file where it will be saved. | ||
- | *BinaryFile: Indicates the type of transfer. Binary when checked or text if unchecked.\\ \\ | ||
- | * **putFile:** Uploads a file from the local computer to the remote FTP. Receives as parameters:\\ | ||
- | *LocalFilePath: Specifies the path and name of the local file to be uploaded. | ||
- | *RemoteFilePath: Indicates the path and file name of the file to be uploaded. | ||
- | *BinaryFile: Indicates the type of transfer. Binary when checked or text if unchecked | ||
- | \\ \\ | ||
- | ====Functions for connection to different FTP server==== | ||
- | * **connect:** Allows you to make a connection to another FTP server, different from the one configured in the adapter setup. If the previous connection is open, it closes it. Receives as parameters, the same initialization parameters of the Adapter:\\ \\ | ||
- | *Host: IP address or host name to which we want to connect. | ||
- | *Port: Port number on which the server is listening, if not reported the adapter will use the default port for the protocol. | ||
- | *User: Username used to establish the connection. | ||
- | *Password: Password of the user used in the previous step. | ||
- | *Secure: Indicates if the connection is secure (SFTP) or not (FTP).\\ | ||
- | * **disconnect:** Allows you to close the connection to the FTP server. This function does not require input parameters. | ||