Re: [basex-talk] Downloading files

2014-08-21 Thread Lars Johnsen
Thanks a lot Andy! It works like a charm. Now the filename can be manipulated as well. Perfect! Best, Lars 2014-08-21 17:10 GMT+02:00 Andy Bunce : > > Hi Lars, > You need to return a sequence of two items: (restxq:response,thedata) > I do something like... > > declare > %rest:path("/download/

Re: [basex-talk] Downloading files

2014-08-21 Thread Andy Bunce
Hi Lars, You need to return a sequence of two items: (restxq:response,thedata) I do something like... declare %rest:path("/download/{$file}") function page:download-file($file) { (download-response("raw",$file), file:read-binary(..)) }; (:~ headers for download :) declare function dow

Re: [basex-talk] Downloading files

2014-08-21 Thread Lars Johnsen
I came a little closer by making custom http:headers, but I have to confess I'm in deep water here: declare %rest:path("/download/{$file}") function page:download-file($file) { }; This function do trigger a download of a file with the appropriate file name (=$fil

[basex-talk] Downloading files

2014-08-21 Thread Lars Johnsen
I am using BaseX restxq for accessing a repository from a web browser. Uploading files works smoothly, but I can't see how to make a download button work. For uploading, the recipie on the restxq help page was enough to get it to work. Is there a corresponding way for making downloading work? What