Name
ftp_put — FTP put command; Virtuoso FTP client
Synopsis
integer
ftp_put
(
|
in server varchar , |
in user varchar , | |
in pass varchar , | |
in local_file_name varchar , | |
in remote_file_name varchar , | |
in
is_pasv
integer
) ; |
Description
Virtuoso has FTP client functionality, that can be used inside Virtuoso/PL. This Virtuoso function mimics the FTP put command. As with any PL, this can be combined with Web Services and SOAP.
Parameters
server
The remote server address or IP Address.
user
The username for authentication at the FTP server.
pass
The accompanying password for authentication at the FTP server.
local_file_name
The full path and file name of the local file to be uploaded. This is relative to the server root directory. This directory must be included in DirsAllowed ACL list in the Virtuoso.INI file.
remote_file_name
Full path and file name to the file on the FTP server to be uploaded.
is_pasv
Flag to specify whether to use passive mode. This can be one "1" for passive mode, or zero "0" for active mode. One "1" is assumed by default.
Return Types
This function returns either 1 for success, or the error returned from the server.
Errors
This function will return any errors returned by the remote FTP server.
Examples
Example 24.121. Uploading a file to an FTP server
To upload the file virtuoso30.tar.gz to the ftp server ftp.openlinksw.com, one can use:
select ftp_put ('ftp.openlinksw.com', 'user_name', 'password', 'virtuoso30.tar.gz', 'virtuoso30.tar.gz');
This will upload the file that occurs on the local server root directory, and save it to the remote servers root directory.