Hello,

This is the code, I am using to upload files. It gives output message as
"Files Uploaded" but i didn't see any files uploaded into ML db.
Any correction in the code?

(: load.xqy :)

let $contentdir := "C:\sam2"
return (
for $x in xdmp:filesystem-directory($contentdir)//dir:pathname/text()
   [ends-with(lower-case(.), ".xml")]

return (

try {
  xdmp:spawn("loadFile.xqy"), "Files Uploaded"
}
catch ($err) {
  $err
}
)
)

(: loadFile.xqy :)

define variable $x as xs:string external
define variable $contentDir as xs:string {"C:\sam2"}

xdmp:document-load($x,
  <options xmlns="xdmp:document-load">
    <uri>{fn:concat("/sam/mcd/",
                    fn:substring-after($x, fn:concat($contentDir,
"\")))}</uri>
    <repair>full</repair>
<forests>
         <forest>{xdmp:forest("test")}</forest>
    </forests>
<encoding>ISO-8859-1</encoding>
  </options>)


-- 
Regards,

Vijayasekar. P,
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to