This page last changed on Dec 02, 2008 by edawson.

Use Confluence's Attachments macro to display the list of attachments that belong to a page.

On this page:

Error formatting macro: toc: java.lang.NullPointerException

Usage

What you need to type What you will get
{attachments}
  Name Size Creator (Last Modifier) Creation Date Last Mod Date Comment  
JPEG File office1.jpg 94 kB Vidya Madabushi Aug 09, 2005 Aug 09, 2005  
JPEG File waterfall.jpg 1.27 MB Vidya Madabushi Aug 09, 2005 Aug 09, 2005  
File editProfile.png 33 kB Sarah Maddox Oct 08, 2007 Oct 08, 2007  

Optional Parameters

Parameter Default Description
patterns all Specify which attachments to display using filename patterns
old false Include old attachments
sortBy date Specify the sort order for attachments. Valid values are "date", "size" and "name".

Examples

1. Filter Attachments by File Name

{attachments:patterns=.*jpg,.*gif}

Use a comma-separated list of regular expressions to specify the filenames of the attachments you want displayed.

Note
The patterns are regular expressions, so to match a file suffix of 'jpg', use .*jpg, not *.jpg.

Here's a detailed tutorial on regular expressions.

2. Include Old Attachments

{attachments:old=true}

An optional true/false value determines whether to show old versions of attachments. This is set to false by default.

Viewing the List of Attachments

When you view the page, you will see a list of attachments. When the attachment is an Office document, you will see a 'View' link as shown in the screen snippet below.

Screenshot: List of attachments from 'Attachments' macro, including Office documents with 'View' link



Click the 'View' link to view the content of the Office document within Confluence. If you have an Office application installed, you will also be able to launch your Office editor from within Confluence. See Displaying an Office Document in Confluence and Working with the Office Connector.

Attachment Information Icon

When a page you are viewing contains attachments, a small paperclip icon like this:     appears next to the page byline. Clicking the paperclip will take you to the 'Attachments View', where the full list of attachments is displayed.

RELATED TOPICS

Working with Attachments Overview
Working with Macros

Take me back to Confluence User Guide


waterfall.jpg (image/jpeg)
office1.jpg (image/jpeg)
editProfile.png (image/png)
editProfile.png (image/png)
Document generated by Confluence on Dec 03, 2008 15:15