4.2.��Links to Page Attachments

A How-To Recipe

Jeff Elpern


Crate a link to an file attached to the current page so that users can download files such as a PDF or binary image.


Use the Knowledge Base technology to access files attached to a page. This also enforces the access rights manager which will protect attached files from unauthorized access.

Prototype of link to page attachment

The paragraphs below present one or more prototypes of how to link MoinMoin attachments within DocBook page.

Prototype Tag Markup

In this prototype the reference to the attached file is hard coded using the MoinMoin page name followed by the MoinMoin action to address a an attached file ?action=AttachFile&do=get&target=test.pdf. The full comand is:

<ulink url="./pageName?action=AttachFile&#x26;do=get&#x26;target=test.pdf">

The & must be expanded to internet save encoding of &#x26;

ULINK Enhanced

One design alternative is to enhance the ULINK tag so that SQI XSL transformations will build the MoinMoin action. The type attribute within ulink exists exactly for this purpose.

Extension Markup: When the type="attachment" parameter is present in the ulink tag, the url parameter is pointing to an attached file. The markup producing the same results as the prototype would be:

<ulink url="test.pdf" type=″attachment″ >

The processing expectation for the url is a simple file name. Anything else, such as a relative file, will cause a processing error.


The SQI DocBook system assembles top level documents such as books from individual Knowledge Base Web pages. In this process model files associated with a page will be attached to that page. This references to external files are to attachments on that page.

This process model - of local files - is superior to the common practice of external files residing on a common location.

Univ/CIE/KA/StrucDoc/HowToBookProto/ChapLinks/attachments (last edited 2015-03-06 18:11:27 by localhost)