Use Confluence's Attachments Macro to display a list of the files attached to the current page. It will generate a table similar to that in the screenshot below.

Screenshot: List of attachments created by the 'Attachments' macro

On this page:

Usage with the Macro Browser

To insert the Attachments macro into a page using the Macro Browser:

  1. Open the Confluence page or blog post that you want to edit, then click the Edit button.
  2. Click the Macro Browser icon on the toolbar. The macro browser window will open.
  3. Scroll through the list of macros to find the one you want. Alternatively, start typing the macro name into the search box at the top right of the macro browser. Macros with a matching name will appear in the main pane.
  4. Click the desired macro.
  5. Set the macro parameters to your requirements. If desired, you can preview these changes by clicking Refresh.
  6. Click Insert to add the macro onto the page.

(tick) You can also insert macros using autocomplete. For more information, see Using Autocomplete in the Rich Text Editor.

Once you've found the Attachments macro, click 'Insert' to add it to your page.

Usage with the Wiki Markup Editor

必要な入力項目

表示結果

{attachments}
  ファイル 最終変更日
JPEG File waterfall.jpg Aug 10, 2005 by Vidya Madabushi
JPEG File office1.jpg Aug 10, 2005 by Vidya Madabushi
PNG File editProfile.png Oct 08, 2007 by SarahA
ZIP Archive summit-slides.zip Apr 28, 2011 by Geoff Crain

パラメーター

Parameters are options that you can include in Confluence macros to control the content or format of the macro output. The table below lists relevant parameters for this macro.

Parameter names are different in the Macro Browser and in wiki markup. Below we show the Macro Browser parameter names in bold text, and the equivalent wiki markup parameters in (bracketed) text. If we do not show any parameter name for the wiki markup, then you should leave out the parameter name and simply include the parameter value as the first parameter, immediately after the colon (:).

パラメーター

既定

説明

Filename Patterns
(patterns)

すべて

Specify which attachments to display using filename patterns.

Include Old Attachment Versions
(old)

false

Include old attachments versions in the list.

Sort By
(sortBy)

日付

Specify the sort order for attachments. Valid values are 'date', 'size' and 'name'. The default sort order is reverse chronological for 'date', largest to smallest for 'size', and alphabetical for 'name'. Note that people viewing the page can change the sort order by clicking the column headings.

Allow Upload
(upload)

false

Adds functionality to allow the upload of new attachments.

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.

注意

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 and Editing Files from the Attachments Macro

If an attachment is an Office or PDF file, you will see a View link as shown in the screen snippet below. Furthermore, if the attachment is an Office file, it will also have an Edit link.

Screenshot: Office and PDF file page attachments showing the 'View' and 'Edit' links



Click the View link to view the content of the Office file within Confluence.

Click the Edit link to edit the content of the Office file in your Office application. You must have a compatible Office application installed to do this. Refer to Working with the Office Connector for more information.

Attachment Information Icon

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

注意

  • The macro can only list the attachments on the current page. It is not possible to display attachments from another page. If you are interested in this feature request, please watch or vote for CONF-6351.
関連トピック

Working with Attachments
Working with Macros

Take me back to the Confluence User's Guide.

  • ラベルなし