-
-
Notifications
You must be signed in to change notification settings - Fork 10
Error when digesting file uploaded as multipart/form-data #103
Copy link
Copy link
Open
Description
tested on: eXist 6.4.0
When trying to PUT or POST a file as multipart/form-data, an error is thrown:
2026-02-10 18:16:32,973 [qtp1906335777-3102] WARN (RESTServer.java [writeResultXML]:2159) - org.xml.sax.SAXException: exerr:ERROR Unable to encode string value: Underlying channel has been closed [at line 145, column 26, source: /db/system/repo/roaster-1.11.0/content/body.xqm]
org.exist.xquery.XPathException: exerr:ERROR Unable to encode string value: Underlying channel has been closed [at line 145, column 26, source: /db/system/repo/roaster-1.11.0/content/body.xqm]
This is the affected code:
let $names := request:get-uploaded-file-name($name)
let $data := request:get-uploaded-file-data($name)
let $sizes := request:get-uploaded-file-size($name)
Changing the order does not change the error; removing the call to -data() does not throw an error.
Workaround, tested on eXist 6.4.0, is to add a function call that returns a new sequence, e.g.
let $data := request:get-uploaded-file-data($name) ! util:base64-decode(.)
(Wild guess: could this be related to lazy variable evaluation?)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels