如何将多个文件上传到xquery中的文件夹?

时间:2012-06-20 13:47:37

标签: xquery marklogic

如何将多个文件上传到xquery中的文件夹?

2 个答案:

答案 0 :(得分:2)

您是否尝试遍历文件系统上的目录并将这些文件插入数据库中的某个位置,如下所示?

for $e in xdmp:filesystem-directory('c:\my-files\')/dir:entry
let $file := xdmp:filesystem-file($e/dir:pathname)
let $dest-uri := concat('/dest-path/',$e/dir:filename)
where ($e/dir:type eq 'file')
return xdmp:document-insert($dest-uri,$file)

答案 1 :(得分:0)

你应该看看Information Studio。它提供了用于加载和转换内容的UI。其中一个内置的“收集器”允许您指向文件系统目录并递归加载其内容。 Information Studio自动处理目录遍历并将负载分解为多个事务,以及许多其他便利。