It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

confluence attachments

Hi,

is there another way to know the file names of the attachment files found in the actual attachment folder in confluence? the folder contains bunch of folders with numbers as foldername, and inside are files without file extension. now, i am guessing that this is where all the attachment goes because I found the path in confluence admin > configuration > attachment storage.

I also have access to the database and I can do some SQL queries if need be.

What I have done so far:

> do a query in the backend
- select attachmentid from attachments where title = 'filename.jpg'

> search the attachmentid in the physical folder.

But I am still not able to find that file. I am now thinking that I may have permanently deleted the file or my method in doing this is incorrect.

Any input is greatly appreciated.

Thank you,
James

2 answers

1 accepted

1 vote
Answer accepted

Hi James, you can refer to the following documentation which explains how to find this file: https://confluence.atlassian.com/display/DOC/Hierarchical+File+System+Attachment+Storage

And you can use the following SQL to query for all attachment paths for a given spacekey:

select '/ver003/'
       || cast(substring(cast(spaceid as VARCHAR), length(cast(spaceid as VARCHAR)) - 2, 3) as INT) % 250
       || '/'
       || cast(substring(cast(spaceid as VARCHAR), length(cast(spaceid as VARCHAR)) - 5, 3) as INT) % 250
       || '/'
       || cast(spaceid as VARCHAR)
       || '/'
       || cast(substring(cast(pageid as VARCHAR), length(cast(pageid as VARCHAR)) - 2, 3) as INT) % 250
       || '/'
       || cast(substring(cast(pageid as VARCHAR), length(cast(pageid as VARCHAR)) - 5, 3) as INT) % 250
       || '/'
       || cast(pageid as VARCHAR)
       || '/'
       || contentid
       || '/'
       || version
  as path, spaceid, contentid, title, pageid, version
from content
where contenttype = 'ATTACHMENT'
      and spaceid = (select spaceid from spaces where spacekey = '<SPACE_KEY>');

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published Thursday in Confluence

Confluence CVEs and common questions

Two vulnerabilities have been published for Confluence Server and Data Center recently: March 20, 2019 CVE-2019-3395 / CVE-2019-3396 April 17, 2019 CVE-2019-3398 The goal of this article is...

353 views 0 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you