Is there a way to get the actual file of an attachment in Confluence via a Java API?

Is it possible to get the actual file stored on the file system for an attachment programatically in a Java plugin? i.e. versioned attachments seem to exist on the file system in a location such as

<install dir>/confluence/home/attachments/ver003/37/65/65537/24/200/950274/1081345/1

I haven't seen a way to get this path in the Attachment object--the urlPath, downloadPath and exportPath don't give me anything useful for this.

3 answers

0 votes
Peter Koczan Atlassian Team Jun 17, 2013


I believe there should be a way, as the Confluence CLI plugin has such a function:

Would that work for you?

Kind regards,


Hi Robert,

there are different storages for files, on the filesystem or in the database. So getting the concrete path depends on the storage strategy and is not always the same.

For filebased storages the directory structure is described here. Hope this helps.



Thanks for the ideas. Found a way to do what I needed to using the content of the attachment instead (available as an InputStream from the Attachment object).

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Dec 18, 2018 in Confluence Cloud

Happy holidays from our team to yours!

Hi Community!  2018 was filled with changes for our team, both big and small, and we've taken a lot of time to both celebrate our wins and recognize areas of improvement. One thing that we're a...

490 views 3 18
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