Getting attachments from document

gkidd picture gkidd · Feb 15, 2012 · Viewed 7.1k times · Source

This is all I need, nothing too fancy: I'm creating an url from files that have been attached in the document, but the document is not opened. I have an xpage where I want to show attachments from specific document. How do I do this?

Thank you in advance.

Answer

stwissel picture stwissel · Feb 15, 2012

The easiest way is to use @AttachmentNames (in a view column) to get the names of the files. Then you can construct the url using db.nsf/0/unid/$file/[filename] -- that's classic, won't run in XPiNC. There is a second URL syntax (need to check) that is XPages specific:

http(s)://[yourserver]/[application.nsf]/xsp/.ibmmodres/domino/OpenAttachment/[application.nsf]/[UNID|/$File/[AttachmentName]?Open

Read my full article on it here: http://www.wissel.net/blog/d6plinks/SHWL-86QKNM

(includes SSJS sample)