file store question
Tuesday, 24 May 2016 · 2 messages · last reply 25 May 2016
WG
Wang, Genneva24 May 2016 23:20 #
Hi BaseX gurus,
I noticed that if the resource is persisted in basex, there is a way to tell what type of the resource it is(
db:content-type?). However, I’m wondering for new resources to be persisted, is there a way to determine ? Or mostly needs to rely on the application to determine which basex call to be make ? I’m seeing on the document that db:store is to persist binary database and use db:add for other documents. Does it mean that the caller really need to know the type of the resource, in order to determine which db function to call ?
Thanks much for your help.
Regards,
-GennevaCG
Christian Grün25 May 2016 07:55 #
Quoted text · Wang, Genneva · 3 lines
> Does it mean that the caller really need to > know the type of the resource, in order to determine which db function to > call ?
Yes – unless you use WebDAV (which will automatically find out if your input is well-formed XML) or the REST API (which will evaluate the specified content type) [1]. Please note that BaseX is primarily an XML database. This is the reason why extra functions for binary contents have been added.
Christian
[1] http://docs.basex.org/wiki/Web_Application
Written for BaseX 8.4. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery