I need to get at an attachment stored in a Lotus Notes Document, using a url.
I can get the document, ok but when I try the url to get the attachment, I get a 404 Attachment not found.
Tried using the examples in the Domino Data Service guide
http://infolib.lotus.com/resources/domino/8.5.3/doc/designer_up1/en_us/DominoDataService.html
The url to get the document is
This produces the json and from here I can see the attachment name (shown below)
"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
when I try the url
https://mym.dev-imaginovation.net/Applications/Correspondence/corr2017.nsf/api/data/documents/unid/FB1620DDCA1D8C538025836000401312/$File/081409362-E_Notif_GoThrough_Regist.PDF
I get a web page
{ "code":404, "text":"Not Found", "message":"Attachment not found" }
Any ideas?
(The links do not work as the dev site is not accessible from the www)
Thanks
Graeme
The data is already in the response to the GET document request:
{
"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 ..."
}
The data
property contains the base64-encoded content of the attachment. The contentTransferEncoding
property tells you how it is encoded.
Depending on what version of Domino you are using, you can also change the GET document request to get an attachment link instead of the attachment content. Just add ?attachmentlinks=true
to the end of the request URL. That will cause the response to have a contentLocation
property -- the value of which is the relative URL of the attachment data.
Important: The attachmentlinks
parameter was added in Domino 9.0.1 FP9. If you are using an older version of Domino, ?attachmentlinks=true
is ignored.