This macro lists all attachments in the current Confluence space, displaying the filename, filetype, creation date, creator, and file size. It retrieves the data using a REST API call and formats it in a sortable AUI table.
#set( $query = "type=attachment and space='${space.key}'" )
#set( $expand = "extensions,version" )
#set( $url = "/wiki/rest/api/content/search?limit=250&expand=${expand}&cql=${query}")
#set( $attachments = $ConfluenceManager.get($url).results )
<table class="aui aui-table-sortable">
<thead>
<tr>
<th></th>
<th> Filename </th>
<th> Filetype </th>
<th> Created On </th>
<th> Created By </th>
<th> Size </th>
</tr>
</thead>
<tbody>
#foreach ( $att in $attachments )
<tr>
<td><a href="${baseUrl}${att._links.download}"><span class="aui-icon aui-icon-small aui-iconfont-download"></span></a></td>
<td>
<a href="${baseUrl}${att._links.webui}">$att.title</a>
</td>
<td> $att.extensions.mediaType </td>
<td> $att.version.friendlyWhen </td>
<td>
<a href="${baseUrl}/people/${att.version.by.accountId}"><span class="aui-lozenge">${att.version.by.publicName}</span></a>
</td>
#set ( $kb = $att.extensions.fileSize / 1024 )
<td> $kb kB </td>
</tr>
#end
</tbody>
</table>Add a configurable floating panel to a Confluence page
Displays a list of pages in specific space with certain title or label
Find image within page attachments. Handy for reuse files and update them all at once
Perform text searches within pages, blog posts, and attachments.
Retrieve and display labels from a specified space
Display information about how many users have access to each space
Generate a list of labels from all spaces leading to corresponding content pages, organized in alphabetical order.
Generate a list of all the content created by a current user by default or a specified user across your Confluence site.
Perform customized searches based on labels, content types, and other parameters.
Display the top comments from a selected Confluence page or the current page by default.