---
title: "How to download all attachments for a space"
canonical: "https://support.appfire.com/space/SUPPORT/89150036/How%20to%20download%20all%20attachments%20for%20a%20space"
format: markdown
---
# One Space

Replace **XYZ** with your space and **tempdir** with the directory you want to put the attachments in.

> ✅ Make sure you create the directory first. Otherwise it will be treated as a file name. If it is a directory, then the attachment name is used as the file name within the directory provided.

```
--action runFromAttachmentList --space XYZ  --common "--action getAttachment --id @pageId@ --name \"@attachment@\" --file tempdir" --continue
```

# All Spaces

Replace **tempdir** with the directory you want to put the attachments in. This can take a long time on larger sites!!!

```
--action runFromAttachmentList --space @all  --common "--action getAttachment --id @pageId@ --name \"@attachment@\" --file tempdir" --continue
```

# To Avoid Duplicate Attachment Names

Attachment names are only unique for the page they are on, so you might want something more precise.

```
--action runFromAttachmentList --space @all  --common "--action getAttachment --id @pageId@ --name \"@attachment@\" --file \"tempdir/@space@/@title@/@attachment@\" --continue
```