From: Joe W. <jo...@gm...> - 2014-03-31 17:28:54
|
Hi Loren, This thread seems to have yielded success - see Adam's last response: http://markmail.org/message/ud2q7klxcfzzslar Joe On Mon, Mar 31, 2014 at 1:09 PM, Loren Cahlander <lor...@gm...> wrote: > eXist 2.2RC1 > > I have a zip file contained within the database. How Can I get it > downloading through RestXQ? > > > > I have started with the following: > > > > > declare > %rest:GET > %rest:path("/get-edd/{$id}") > function eim:get-edd($id as xs:string) { > let $filename := $id || '.zip' > let $path := $config:data-root || '/CDXF_EIM/edd/' || $filename > let $available := util:binary-doc-available($path) > return (<rest:response> > <output:serialization-parameters> > <output:media-type value='application/zip'/> > </output:serialization-parameters> > </rest:response>, util:binary-doc($path)) > }; > > > > > > > > I had the following working in a XQuery script file: > > > > let $zip := compression:zip((xs:anyURI($new-collection)), false()) > let $stored := xmldb:store($edd-dir, $new-dir-name || '.zip', $zip, > 'application/zip') > let $response := response:stream-binary($zip, "media-type=application/zip", > $new-dir-name || '.zip') > return > $response > > What do I need to do in RestXQ to get the desired result? > > . > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Exist-open mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-open > |