Christian,

Thanks for the pointer. I'll see if I can update the docs to more clearly cover this use case. 

Cheers,

E. 

From: Christian Grün <christian.gruen@gmail.com>
Sent: Thursday, July 7, 2022 4:09 AM
To: Eliot Kimber <eliot.kimber@servicenow.com>
Cc: basex-talk@mailman.uni-konstanz.de <basex-talk@mailman.uni-konstanz.de>
Subject: Re: [basex-talk] RESTXQ: Serve images that are not within the web app dir
 
[External Email]


Hi Eliot,

> I would like to serve the images from RESTXQ-generated HTML Pages but I’m not sure how to do that other than to use URLs that include the base64 image data directly.

The DBA code contains such an endpoint [1]. Memory consumption will be
constant: As file:read-binary is used, the binary data will be
streamed directly to the client [2]. The used headers (Cache-Control,
Content-Length) are optional and can be arbitrarly adjusted.

Best,
Christian

[1] https://urldefense.com/v3/__https://github.com/BaseXdb/basex/blob/da1e55d0214e44c1532f121c282021db50a9aa51/basex-api/src/main/webapp/dba/common.xqm*L21-L41__;Iw!!N4vogdjhuJM!EvayIKl0SyXhq26Ctqua4mq4856Caiq9GjaVNKgILgubHKtuzRyAu4IQqUylXp6PnhaAGcBXs0AP_2w7-bJC-t0JcLVOzks$
[2] https://urldefense.com/v3/__https://docs.basex.org/wiki/Lazy_Module__;!!N4vogdjhuJM!EvayIKl0SyXhq26Ctqua4mq4856Caiq9GjaVNKgILgubHKtuzRyAu4IQqUylXp6PnhaAGcBXs0AP_2w7-bJC-t0JPvmCh9c$