August 24, 2026

You have a large folder of individual documents — PDFs, text files, whatever — and you want each one to become its own item on the Internet Archive, without typing out an ia upload command by hand for every single file. This walks through doing that safely and repeatably using ia’s built-in spreadsheet feature.
Before uploading anything, check that your PDFs aren’t corrupted. A broken file mid-batch can cause an upload to fail partway through, so it’s worth catching problems early:
brew install qpdf
find /path/to/your/documents -name "*.pdf" -exec qpdf --check {} \; 2>&1 | grep -B1 error
Repair anything flagged as a real error before moving on. (Opening a corrupted PDF in Preview and printing it to a new PDF is often enough to fix it.)
Rather than writing a separate ia upload command for every file, ia supports a CSV spreadsheet where each row describes one file and its destination item. A small script can build this automatically by scanning your folder:
#!/bin/bash
SOURCE_DIR="/path/to/your/documents"
OUTPUT_CSV="upload_metadata.csv"
IDENTIFIER_PREFIX="myproject_"
echo "identifier,file,title,mediatype,collection,creator,language" > "$OUTPUT_CSV"
for filepath in "$SOURCE_DIR"/*; do
filename=$(basename "$filepath")
name_no_ext="${filename%.*}"
clean_id=$(echo "$name_no_ext" \
| tr '[:upper:]' '[:lower:]' \
| sed 's/[^a-z0-9]/_/g' \
| sed 's/_\+/_/g' \
| sed 's/^_//;s/_$//')
identifier="${IDENTIFIER_PREFIX}${clean_id}"
title="$name_no_ext"
echo "\"$identifier\",\"$filepath\",\"$title\",texts,opensource,,eng" >> "$OUTPUT_CSV"
done
echo "Wrote $(($(wc -l < "$OUTPUT_CSV") - 1)) entries to $OUTPUT_CSV"
Run it:
chmod +x generate_upload_csv.sh
./generate_upload_csv.sh
This produces upload_metadata.csv — one row per file, each with an auto-generated identifier and title.
Open the CSV in Excel, Numbers, or Google Sheets before uploading anything. This is your chance to:
description or subject column if you want oneia upload --spreadsheet=upload_metadata.csv --checksum --retries=120 --sleep=120
--checksum makes this safe to re-run — already-uploaded files are automatically skipped.--retries and --sleep give the upload resilience against network hiccups.Before running this against thousands of files, try it on a handful first (5–10 rows). Confirm the resulting items look right — correct title, correct file, correct identifier — before committing to the full collection.
As with any large batch, a single failed upload can cut off processing partway through. Redirect output to a log file so you can review it afterward instead of relying on scrollback:
ia upload --spreadsheet=upload_metadata.csv --checksum --retries=120 --sleep=120 2>&1 | tee upload_log.txt
grep "error uploading" upload_log.txt
That’s it — a repeatable way to turn a folder of individual documents into a properly cataloged set of items on the Internet Archive, without hand-writing a command for each one.