Confluence 2.5 has reached end of life
Check out the [latest version] of the documentation
This page is outdated. Please see new page.
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. |
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. |
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
