# `dump_files` List file attachments as JSON ## Usage > pdftl `` `dump_files` `[output` `]` ## Details The `dump_files` operation lists files attached to the input PDF as JSON. Each attachment is an object with the following fields (all optional except `key` and `filename`): | Field | Description | | :------------ | :----------------------------------------------------------- | | `key` | Internal NameTree key (may differ from `filename`) | | `filename` | Attachment filename as stored in the filespec | | `description` | Human-readable description, if present | | `mime_type` | MIME type (e.g. `/text/plain`, `/application/pdf`) | | `relationship`| Relationship type (e.g. `Source`, `Data`, `Unspecified`) | | `file_size` | Uncompressed file size in bytes | | `stored_size` | Size as stored in PDF (compressed), in bytes | | `compression` | PDF filter name (e.g. `/FlateDecode`), if compressed | | `created` | Creation date in PDF date format | | `modified` | Modification date in PDF date format | | `pages` | List of pages this attachment is attached to | Note: document-level attachments are attachments which are not attached to any pages. In this case, the `pages` field is absent. ## Examples > List all files attached to a.pdf as JSON ``` pdftl a.pdf dump_files ``` > List attachments larger than 1MB ``` pdftl a.pdf dump_files | jq '.[] | select(.file_size > 1000000)' ``` > List just the filenames of all attachments ``` pdftl a.pdf dump_files | jq '.[].filename' ``` **Tags**: attachments, info *Source: pdftl.operations.attachments* *Read online: [https://pdftl.readthedocs.io/en/latest/operations/dump_files.html](https://pdftl.readthedocs.io/en/latest/operations/dump_files.html)* *Type: Operation*