Hi Christian, I unzipped a version 8.5.1 I already had on my harddisk and the behaviour is the same. File is uploaded as base64 encoded. So I downloaded a version 8.5.3 and this time it behaves as expected (with and without MIXUPDATES) as the file appears as binary data in the raw folder. I suppose there has been some kind of fix between the two versions. Could this be? I don't know whether I can quickly move to the new version but I think I should ... Regards, Marco.
On 14/08/2016 23:34, Christian Grün wrote:
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) };