How to fix unability to save ".eps" file to marklogic database because XDMP-JSONDOC error is thrown?

huangapple go评论54阅读模式
英文:

How to fix unability to save ".eps" file to marklogic database because XDMP-JSONDOC error is thrown?

问题

我无法将扩展名为“.eps”的文件保存到MarkLogic数据库中。Marklogic REST API引发了以下错误消息的服务器错误:“XDMP-JSONDOC:文档不是JSON”。重要的是,我有几个数据库实例,每个都在不同的环境中,但我只能在其中一个实例上保存此文件。

因此,我认为这个实例配置不正确,并发现xdmp.mimetypes()返回的四种MIME类型与MIME类型管理页面上显示的不同。

更重要的是,从xdmp.mimetypes()返回的“application/postscript” MIME类型配置具有“json”格式,而通过MIME类型管理页面配置的具有有效的“binary”格式。我认为这可能导致无法保存“.eps”文件。

为什么存在这些差异,我该如何解决这个问题?

英文:

I am unable to save file with ".eps" extension to MarkLogic database. Marklogic REST API throws server error with following message: "XDMP-JSONDOC: Document is not JSON". What is important is that I have several instances of database, each on different environment and I am unable to save this file only on one of those instances.

So I assumed that this one instance is configured improperly and found out, that there are differences between four mimetypes returned by xdmp.mimetypes() and those shown on mimetypes admin page.

What is more, config for mimetype "application/postscript" returned from xdmp.mimetypes() has "json" format, and one configured via mimetypes admin page has valid "binary" format. I think that this may cause inability to save ".eps" file.

Why do those differences exist and how can I solve this issue?

答案1

得分: 1

eps应该是二进制格式。

在我的系统上,eps的MIME类型为:

{
    "mimetype": "application/postscript",
    "extensions": "ai eps ps",
    "format": "binary"
}

如果您的集群中有一个针对eps的MIME类型声明为json,请修复它。也许有人将格式从二进制更改为json,或者他们添加了集群配置的新MIME类型。检查MIME类型配置,找到错误并纠正它。

您可以通过Admin UI或通过API调用admin.mimetype()admin.mimetypesDelete()admin.mimetypesAdd来执行此操作。

英文:

eps should be binary format.

On my system, the mimetype for eps has:

{
"mimetype": "application/postscript", 
"extensions": "ai eps ps", 
"format": "binary"
}

If you have a cluster with a mimetype declaration of json for eps, then fix it. Maybe someone changed the format from binary to json, or maybe they added a new mimetype to the cluster config. Inspect the mimetype configs, find the mistake, and correct it.

You can do this via the Admin UI or via API calls to admin.mimetype(), admin.mimetypesDelete(), and admin.mimetypesAdd.

huangapple
  • 本文由 发表于 2023年7月24日 19:39:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/76754108.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定