Created
November 15, 2017 19:21
-
-
Save tonyahowe/a62e83b078a04aa7f2fcef1d48ba771b to your computer and use it in GitHub Desktop.
Where to put the console:log in this function?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare function app:upload($node as node(), $model as map(*)) { | |
let $collection := '/db/apps/NiC/inReview/' | |
let $filename := request:get-uploaded-file-name('file') | |
(: make sure you use the right user permissions that has write access to this collection :) | |
let $login := xmldb:login($collection, 'public', 'public') | |
let $store := xmldb:store($collection, $filename, request:get-uploaded-file-data('file')) | |
(: I want to see what it's pulling for $filename--I'm getting a SAX prolog error, but there's nothing worrisome in the XML file I'm trying to upload :) | |
return | |
<results> | |
<message>File {$filename} has been stored at collection={$collection}.</message> | |
</results> | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using the
console:log()
function you'll have to import the module likeat the top of your XQuery.
Then add e.g.
after
let $filename …
in line 5