So this is what I tried:
* I modified the recent query and added a full path (.../service/files/image.png):
* I started the BaseX HTTP Server listening on port 10000
* I modified the RESTXQ function by removing $userid (otherwise, it could not be parsed) and wrapping rest:response with db:output() and adding %updating (probably you are working with MIXUPDATES=true?)
* I created a "files" database
* I evaluated the query.
The file will be stored as expected (in its binary form) in the database. What else could I do to understand what may be going wrong? Maybe it’s something else not related to what we’ve discussed so far? Does the problem also happen with a fresh installation of BaseX (with all the default options)?
Christian
QUERY:
http:send-request( <http:request method="POST">, <http:body media-type="image/png"/> </http:request>, "http://localhost:10000/service/files/image.png", bin:hex('414243') )
RESTXQ:
module namespace m = "m"; declare %updating %rest:path("/service/files/{$name}") %rest:POST("{$body}") function m:upload-maps($name, $body) { db:store("files", $name, $body) };