PostgreSQL Query for Downloading Attachments from Confluence Edited

I recently had to download all the .swf file from our confluence site.
The solution online sent me to a page that showed the attachments and then I had to click someting to download it.
This gave me a direct link to every file I needed.

Below is the PostgreSQL query created to assist me in this task.

SELECT title, version, pageid, 
'​h​t​t​p​s​:​/​/your-server-here/​d​o​w​n​l​o​a​d​/​a​t​t​a​c​h​m​e​n​t​s/' || pageid || '/' || title || '?version=' || version as URL
FROM content 
WHERE contenttype = 'ATTACHMENT' 
AND title like '%.swf' 
AND prevver IS NULL 
AND spaceid IS NOT NULL 
ORDER BY lastmoddate DESC

From here you could do all kinds of things like generate a CURL command and pull every file down.
For me I just emailed the URL column to myself and clicked each link. 

0 comments

Comment

Log in or Sign up to comment
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Confluence

Three common content challenges + how to manage them

An efficient enterprise content management system, or ECM, is a must-have for companies that create work online (cough   cough, all companies). If content calendars, marketing plans, and bu...

115 views 0 6
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