ui5应用程序中附件的问题,Notes数据库作为后端
问题描述:
我正在开发ui5中的应用程序。 '模型'是一个笔记数据库。现在,我通过JSON获取笔记文档。我想在ui5的上传集合中显示附件。 JSON正在返回附件,但我无法理解它。对于例如我附加了一个PDF文档,但JSON显示为我附加了3个不同的文件。该文件也是Base64格式。ui5应用程序中附件的问题,Notes数据库作为后端
我希望能够下载和上传附件。
以下是在JSON的附件栏细节(只有1场没有别的文件“多米诺访问Service.pdf”):
"Attach_ProductDetails":
{
"type":"multipart",
"content": [
{
"contentType":"multipart\/mixed; Boundary=\"0__=4EBB0B01DFD9A4D28f9e8a93df938690918c4EBB0B01DFD9A4D2\""
},
{
"contentType":"multipart\/alternative; Boundary=\"1__=4EBB0B01DFD9A4D28f9e8a93df938690918c4EBB0B01DFD9A4D2\"",
"boundary":"--0__=4EBB0B01DFD9A4D28f9e8a93df938690918c4EBB0B01DFD9A4D2"
},
{
"contentType":"text\/plain; charset=US-ASCII",
"data":" (See attached file: 1. Domino Access Service.pdf)",
"boundary":"--1__=4EBB0B01DFD9A4D28f9e8a93df938690918c4EBB0B01DFD9A4D2"
},
{
"contentType":"text\/html; charset=US-ASCII",
"contentDisposition":"inline",
"data":"<html><body><i>(See attached file: 1. Domino Access Service.pdf)<\/i><\/body><\/html>\r\n",
"boundary":"--1__=4EBB0B01DFD9A4D28f9e8a93df938690918c4EBB0B01DFD9A4D2"
},
{
"contentType":"application\/pdf; name=\"1. Domino Access Service.pdf\"",
"contentID":"<[email protected]>",
"contentDisposition":"attachment; filename=\"1. Domino Access Service.pdf\"",
"contentTransferEncoding":"base64",
"data":"<Base64 data>",
"boundary":"--0__=4EBB0B01DFD9A4D28f9e8a93df938690918c4EBB0B01DFD9A4D2"
}
]
}
这将是很大的帮助,如果任何人有解决方案相同。
答
它没有给你三个文件。它向您展示了名为Attach_ProductDetails的富文本字段的两个替代渲染,其中包含代表附加文件的图标 - 它认为您可能需要。该富文本字段中还可能有其他数据。 API不知道你想要什么,所以它给你提供了一切 - 如果你不准备处理text/html,它也会给你一个文本/纯文本渲染。
它还为您提供文件附件数据,标记为“application/pdf”内容类型。您需要解码base64数据并存储它,以便您可以显示它(或其他应用程序想要使用的数据)。