Download the specified file.
 

1 ftp.get

<ftp.get
    name='name'
    localname='localname'
/>

Exceptions

attribute 'name' required

Tha name of the file to download has not been specified.

do not activate ftp connection

It is not possible to obtain the FTP communication with the server because there is not established.

java.io.FileNotFoundException: RETR [...] No such file or directory

There is no file whose name matches the one specified in the name attribute.

java.io.FileNotFoundException: RETR [..] Not a regular file

The file indicated for download is of directory type.

Example

Download a file of the FTP server, storing it in the database.

Copy
<xsql-script name='ftp_sample2'>
    <body>
        <ftp host='192.168.10.1' user='ftpuser' password='ftpdeister'>
            <insert table='files' columns='image'>
                <value><ftp.get name='snowfall.jpg' /></value>
            </insert>
        </ftp>
    </body>
</xsql-script>

To download files you should use the function <ftp.get>. An application of this function will consist in being able to download files of a remote server to store them in a database. Starting from that premise, the XSQL-Script has been executed in a application server, the image snowfall.jpg is downloades from the FTP server with the adress 192.168.10.1 and it is inserted in the image column of the tables files of the database indicated in the command ws-dbscript. The column must be defined with the data type BLOB (Binary Large OBject).