This page last changed on Apr 19, 2007 by cmiller.

Attachments Macro

Usage: {attachments:patterns=pattern, ...|old=true/false|sortBy=name/size/date|upload=true/false} the patterns, old and sortBy arguments are alll optional
Description: Show a list of attachments belonging to the current page.

Optionally filter attachments by name, optionally include old attachments, optionally allow uploads of new attachments.
Example:
{attachments:patterns=.*jpg,.*gif|old=true|sortBy=date}
Input: patterns An optional comma separated list of regular expressions, any of which must match a complete file name for it to included in the output of the macro. Note that the patterns are regular expressions, so to match a file suffix of 'jpg', use .*jpg, not *.jpg.
old An optional true/false value which determines whether to show old versions of attachments. False by default.
Output: A list of attachments belonging to the current page.
Bundled with Confluence?: Yes

Here's a detailed tutorial on regular expressions, but often you just need to know that '.' matches any character and '' matches zero or more occurences of the preceding character. So '.' in a regular expression matches anything (including nothing).

The regular expression pattern 'a.jpg' will match 'a123.jpg', 'axxxxxxxxjpg' or 'ajpg'. The regular expression '.*handout.' would match 'Biology handout number one.doc', 'Chemistry handout2.txt' or 'handout'.

Issue

There is a current issue open against this bug that prevent the "old" parameter to work on Confluence 2.3.3 onwards. Please see CONF-8297 for more details.

This bug is fixed in Confluence 2.4.6

Document generated by Confluence on May 01, 2007 19:28