How to search specific attachment type in Confluence

Still need help?

The Atlassian Community is here for you.

Ask the community


This article only applies to Atlassian's server products. Learn more about the differences between cloud and server.

Purpose

This page contains a few way to search and list out all attachments in Confluence that has a specific extension or file type.

In this example, we are searching for all attachment with the extension .png

Solution

From the UI - Use Confluence's search syntax

  • Go to Search > AdvancedSearch

  • Choose Attachment in the Of Type section

  • Use the following search syntax to search the desired attachment type

    /.*<attachment type>.*/          Example: /.*png.*/

From the Database:

Use the following SQL query:

select c.TITLE as Attachment_Name, 
s.spacename,
c2.TITLE as Page_Title,
'http://<confluence_base_url>/pages/viewpageattachments.action?pageId='||c.PAGEID as Location
from CONTENT c
join CONTENT c2 ON c.PAGEID = c2.CONTENTID
join SPACES s on c2.SPACEID = s.SPACEID
where c.CONTENTTYPE = 'ATTACHMENT' and c.title like '%.png%';

The result will be as follows

From the Attachment folder:

Use the following unix search syntax:

find /<confluence_home>/attachments -type f | xargs file | grep PNG

(warning) Will only work on some specific platforms.

Description How to find attachments with specific extensions in the UI, database, as well as in the hard disk.
Product Confluence
Last modified on Aug 1, 2019

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.