无法从 url 获取附件
Unable to get at attachment from url
我需要使用 url.
获取存储在 Lotus Notes 文档中的附件
我可以获取文档,好的,但是当我尝试 url 获取附件时,我收到 404 找不到附件。
尝试使用 Domino 数据服务指南中的示例
http://infolib.lotus.com/resources/domino/8.5.3/doc/designer_up1/en_us/DominoDataService.html
获取文档的url是
这会生成 json,从这里我可以看到附件名称(如下所示)
"boundary":"--0__=8FBB096ADFDA03268f9e8a93df938690918c8FBB096ADFDA0326"
},
{
"contentType":"application\/octet-stream; name=\"081409362-E_Notif_GoThrough_Regist.PDF\"",
"contentID":"<2__=8FBB096ADFDA03268f9e8a93df93869091@local>",
"contentDisposition":"attachment; filename=\"081409362-E_Notif_GoThrough_Regist.PDF\"",
"contentTransferEncoding":"base64",
"data":"JVBERi0xLjQKJeLjz9MKMSAwIG9iaiA8PC9EZWNvZGVQYXJtczw8L0sgLTEvQ29sdW1ucyAyN
当我尝试 url
https://mym.dev-imaginovation.net/Applications/Correspondence/corr2017.nsf/api/data/documents/unid/FB1620DDCA1D8C538025836000401312/$File/081409362-E_Notif_GoThrough_Regist.PDF
我得到一个网页
{
"code":404,
"text":"Not Found",
"message":"Attachment not found"
}
有什么想法吗?
(链接不起作用,因为无法从 www 访问开发站点)
谢谢
格雷姆
数据已经在对 GET 文档请求的响应中:
{
"contentType":"application\/octet-stream; name=\"081409362-E_Notif_GoThrough_Regist.PDF\"",
"contentID":"<2__=8FBB096ADFDA03268f9e8a93df93869091@local>",
"contentDisposition":"attachment; filename=\"081409362-E_Notif_GoThrough_Regist.PDF\"",
"contentTransferEncoding":"base64",
"data":"JVBERi0xLjQKJeLjz9MKMSAwIG9iaiA8PC9EZWNvZGVQYXJtczw8L0sgLTEvQ29sdW1ucyAyN ..."
}
data
属性 包含附件的 base64 编码内容。 contentTransferEncoding
属性 告诉你它是如何编码的。
根据您使用的 Domino 版本,您还可以更改 GET 文档请求以获取附件 link 而不是附件内容。只需将 ?attachmentlinks=true
添加到请求 URL 的末尾即可。这将导致响应具有 contentLocation
属性 -- 其值是附件数据的相对值 URL。
重要提示: Domino 9.0.1 FP9 添加了 attachmentlinks
参数。如果您使用的是旧版本的 Domino,?attachmentlinks=true
将被忽略。
“$file”URL 路径不是 'api/data' 路径,但您可以使用 unid 和文件名构建替代路径(假设您只想要老式的附件在任何 Domino 服务器上的方式):
或更一般地说:
domain/app-path/db.nsf/view/key/$file/filename
domain/app-path/db.nsf/view/unid/$file/filename
或使用“0”作为视图名称占位符:
domain/app-path/db.nsf/0/unid/$file/filename
我需要使用 url.
获取存储在 Lotus Notes 文档中的附件我可以获取文档,好的,但是当我尝试 url 获取附件时,我收到 404 找不到附件。
尝试使用 Domino 数据服务指南中的示例
http://infolib.lotus.com/resources/domino/8.5.3/doc/designer_up1/en_us/DominoDataService.html
获取文档的url是
这会生成 json,从这里我可以看到附件名称(如下所示)
"boundary":"--0__=8FBB096ADFDA03268f9e8a93df938690918c8FBB096ADFDA0326"
},
{
"contentType":"application\/octet-stream; name=\"081409362-E_Notif_GoThrough_Regist.PDF\"",
"contentID":"<2__=8FBB096ADFDA03268f9e8a93df93869091@local>",
"contentDisposition":"attachment; filename=\"081409362-E_Notif_GoThrough_Regist.PDF\"",
"contentTransferEncoding":"base64",
"data":"JVBERi0xLjQKJeLjz9MKMSAwIG9iaiA8PC9EZWNvZGVQYXJtczw8L0sgLTEvQ29sdW1ucyAyN
当我尝试 url
https://mym.dev-imaginovation.net/Applications/Correspondence/corr2017.nsf/api/data/documents/unid/FB1620DDCA1D8C538025836000401312/$File/081409362-E_Notif_GoThrough_Regist.PDF
我得到一个网页
{ "code":404, "text":"Not Found", "message":"Attachment not found" }
有什么想法吗?
(链接不起作用,因为无法从 www 访问开发站点)
谢谢
格雷姆
数据已经在对 GET 文档请求的响应中:
{
"contentType":"application\/octet-stream; name=\"081409362-E_Notif_GoThrough_Regist.PDF\"",
"contentID":"<2__=8FBB096ADFDA03268f9e8a93df93869091@local>",
"contentDisposition":"attachment; filename=\"081409362-E_Notif_GoThrough_Regist.PDF\"",
"contentTransferEncoding":"base64",
"data":"JVBERi0xLjQKJeLjz9MKMSAwIG9iaiA8PC9EZWNvZGVQYXJtczw8L0sgLTEvQ29sdW1ucyAyN ..."
}
data
属性 包含附件的 base64 编码内容。 contentTransferEncoding
属性 告诉你它是如何编码的。
根据您使用的 Domino 版本,您还可以更改 GET 文档请求以获取附件 link 而不是附件内容。只需将 ?attachmentlinks=true
添加到请求 URL 的末尾即可。这将导致响应具有 contentLocation
属性 -- 其值是附件数据的相对值 URL。
重要提示: Domino 9.0.1 FP9 添加了 attachmentlinks
参数。如果您使用的是旧版本的 Domino,?attachmentlinks=true
将被忽略。
“$file”URL 路径不是 'api/data' 路径,但您可以使用 unid 和文件名构建替代路径(假设您只想要老式的附件在任何 Domino 服务器上的方式):
或更一般地说:
domain/app-path/db.nsf/view/key/$file/filename
domain/app-path/db.nsf/view/unid/$file/filename
或使用“0”作为视图名称占位符:
domain/app-path/db.nsf/0/unid/$file/filename