跳转到内容

XQuery/FTP 客户端

来自维基教科书,开放世界中的开放书籍

您希望直接从 XQuery 程序中与远程运行的 FTP 服务器进行交互。 您希望执行诸如列出、获取和放置文件等操作。

FTP 模块接口

[编辑 | 编辑源代码]

FTP 模块具有以下接口

  ftpclient:get-connection($host as xs:string, $username as xs:string, $password as xs:string) xs:long?
  ftpclient:list($connection-handle as xs:long, $remote-directory as xs:string) document-node()?
  ftpclient:get-binary-file($connection-handle as xs:long, $remote-directory as xs:string, $file-name as xs:string) xs:base64Binary?
  ftpclient:send-binary-file($connection-handle as xs:long, $remote-directory as xs:string, $file-name as xs:string, $data as xs:base64Binary) xs:boolean

示例用法

[编辑 | 编辑源代码]

在此示例中,我们将打开到远程 FTP 服务器的连接,登录并列出文件。

华夏公益教科书