---
title: "List page attachments using injection via File Viewer macro"
canonical: "https://support.appfire.com/space/REPS/472917175/List%20page%20attachments%20using%20injection%20via%20File%20Viewer%20macro"
format: markdown
---
> Macro (aura-html)

## Scenario

Use the File Viewer macro to report on attachments used in the current page.

The report lists all attachments on the page and shows a thumbnail preview.

If the page does not have any attachments, the message *No files have been attached to this page* will be displayed.

## Result

![image](media://9bab0bc6-90ff-4ffa-8c3b-cc55f9f21a3b)

## Recipe

| Apps | Reporting for Confluence Data Center |
| --- | --- |
| Level | Intermediate |
| Estimated time | 5 minutes |
| Macros | Local Reporter, Report Block, Report Body, Report Empty, Report Info, Report Wrapper |
| Suppliers | Attachment Supplier, Content Supplier |

## Storage format

You can copy and paste this code into the [Confluence Source Editor](https://appfire.atlassian.net/wiki/spaces/REPS/pages/472907841):

```

<ac:structured-macro ac:name="report-block" ac:schema-version="1" ac:macro-id="75916e18-eaf0-4808-80fc-27e8289165ef"><ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter><ac:rich-text-body><ac:structured-macro ac:name="local-reporter" ac:schema-version="1" ac:macro-id="63bbf787-e471-422c-8eed-adb48d3f7895"><ac:parameter ac:name="">content:attachments</ac:parameter><ac:rich-text-body><br /></ac:rich-text-body></ac:structured-macro><ac:structured-macro ac:name="report-body" ac:schema-version="1" ac:macro-id="f417d833-084d-4985-bc67-e3dbd256ef6c"><ac:parameter ac:name="injected">true</ac:parameter><ac:rich-text-body>
<p><ac:structured-macro ac:name="report-info" ac:schema-version="1" ac:macro-id="fc895489-5a4d-4d6a-b33e-d36e003c67a4"><ac:parameter ac:name="link">true</ac:parameter><ac:parameter ac:name="">attachment:title</ac:parameter></ac:structured-macro>:</p><ac:structured-macro ac:name="report-wrapper" ac:schema-version="1" ac:macro-id="07199c33-5591-4b23-afee-ccc5ae5c3f89"><ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter><ac:rich-text-body>
<p><ac:structured-macro ac:name="view-file" ac:schema-version="1" ac:macro-id="d0eb00d1-c1f4-4bd4-83f5-ccc15ef3aef0"><ac:parameter ac:name="name"><ri:attachment ri:filename="%attachment:title%" /></ac:parameter><ac:parameter ac:name="height">150</ac:parameter></ac:structured-macro></p></ac:rich-text-body></ac:structured-macro></ac:rich-text-body></ac:structured-macro><ac:structured-macro ac:name="report-empty" ac:schema-version="1" ac:macro-id="39550162-0c25-45cc-b195-42be150b6a29"><ac:rich-text-body>
<p><em>No files have been attached to this page.</em></p></ac:rich-text-body></ac:structured-macro></ac:rich-text-body></ac:structured-macro>

```

## Macro structure

You can recreate the example in the editor view:

![image](media://4db957c0-c918-45b1-a0ce-f0f8685c7323)