Hello Dirk,
Thank you for such a quick response.
However, what is the actual reason to put the binary into a map?
I don’t know - it’s BaseX that is doing it. For files uploaded via POST they are put into a map. I’m using the information here: http://docs.basex.org/wiki/RESTXQ#File_Uploads
"The file contents are placed in a map, with the filename serving as key.”
I would try to use the streaming capabilities and to store the binary as-is.
This would be perfect but I’m not sure how to get the binary from the POST request without using the map.
I have a function something like this:
declare %rest:POST("{$data}") %rest:path("/test2.htm") %rest:consumes("multipart/form-data") %rest:form-param("zip", "{$files}") function _:test($data,$files, $database) { ... };
If I just save $data to disk I don’t get a valid Zip file. $data type is xs:base64Binary but is not the same as the xs:base64Binary from $files. To save the file from $files I have to use the map and so get the error.
Is there a trick to get $data in the right format to match what I get from $files?
Many thanks, James