Download KoboToolbox Attachments
kobo_download_attachmentsDownload submission attachments from KoboToolbox forms, including photos, audio, video, and files, organized into folders per submission.
Instructions
Download the photos, audio, video and files attached to submissions.
A form with an 'image' question (a shopfront photo, a signed consent form, a damaged crop) stores its files on Kobo, and nothing in an Excel export contains them — only file names. This fetches the actual files to disk, organised one folder per submission.
Args:
uid (string): asset uid of the form
submission_ids (array, optional): limit to these submissions; omit for all
output_dir (string, optional): where to write (default: /_attachments)
max_files (number, default 200): safety cap
Returns: the directory written, the number of files and their total size.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | Asset uid of the form | |
| max_files | No | Safety cap on how many files to pull | |
| output_dir | No | Directory to write the files into (default: <output dir>/<form>_attachments) | |
| submission_ids | No | Limit to these submissions. Omit to fetch attachments from all of them. |