Download all attachments from a Confluence Cloud space
Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.
Summary
Confluence Cloud does not have a native feature to download all attachments from a space into a single folder. Use a space export for archival or review, or use the Confluence REST API for an automated or tailored approach.
Solution
While there is no single-click button to download all attachments, you can use the following methods to extract them from your space.
Approach | Use it when |
Space export | You need an archive or want to review the attachments. The HTML export is generally preferred for archival purposes because it preserves the original filenames. |
Confluence REST API | You want a more automated or tailored approach, including control over the final folder structure and naming conventions. |
Option 1: Extract attachments from a space export
When you perform a space export to HTML or XML, Confluence includes all attachments within the resulting zip file. The HTML export is generally preferred for archival purposes as it preserves the original filenames.
Go to Space Settings, then select Export space from the Manage space card.
Select HTML or XML, then select Next.
Select Full Export, or select Custom Export if you need only specific pages.
Select Export.
After the export finishes, download and unzip the file on your local machine.
Navigate to the attachment directory in the unzipped folder:
For an HTML export, attachments are in
download/attachments/<pageId>/.For an XML export, attachments are in
attachments/<pageId>/<attachmentId>/<version>.
Note: XML exports organize files by ID rather than filename. HTML exports preserve the original filenames but organize them into subfolders based on the Page ID.
Option 2: Use the Confluence REST API
To use the Confluence REST API, you need an Atlassian API token and the appropriate space permissions.
For a more automated or tailored approach, you can use the Confluence REST API to programmatically download attachments. This method allows you to control the final folder structure and naming conventions.
Retrieve a list of all pages in the space with
GET /wiki/rest/api/content?spaceKey=<SPACE_KEY>.For each page ID, list the attachments with
GET /wiki/rest/api/content/<pageId>/child/attachment.Download each file with the
_links.downloadURL provided in the API response.
Was this helpful?