Use case · 31 files

Test error handling with corrupt files

Broken files reach every app eventually: interrupted uploads, half-written recordings, damaged archives and hand-edited JSON. These files reproduce each kind of corruption safely, so you can check that your code fails with a clear message instead of a crash, a hang or a half-processed result.

Download all with curl
Download 31 files (6.6 MB)Shell
# 31 files, 6.6 MB in total
while read -r url; do curl -LO --fail "$url"; done <<'EOF'
https://files.samplefiles.com/edge-cases/corrupt/truncated.jpg
https://files.samplefiles.com/edge-cases/corrupt/truncated.png
https://files.samplefiles.com/edge-cases/corrupt/truncated.gif
https://files.samplefiles.com/edge-cases/corrupt/truncated.webp
https://files.samplefiles.com/edge-cases/corrupt/truncated.mp4
https://files.samplefiles.com/edge-cases/corrupt/truncated.mp3
https://files.samplefiles.com/edge-cases/corrupt/truncated.wav
https://files.samplefiles.com/edge-cases/corrupt/truncated.flac
https://files.samplefiles.com/edge-cases/corrupt/truncated.pdf
https://files.samplefiles.com/edge-cases/corrupt/truncated.zip
https://files.samplefiles.com/edge-cases/corrupt/truncated.docx
https://files.samplefiles.com/edge-cases/corrupt/truncated.xlsx
https://files.samplefiles.com/edge-cases/corrupt/truncated.epub
https://files.samplefiles.com/edge-cases/corrupt/bad-signature.png
https://files.samplefiles.com/edge-cases/corrupt/bad-header.jpg
https://files.samplefiles.com/edge-cases/corrupt/crc-mismatch.zip
https://files.samplefiles.com/edge-cases/corrupt/corrupted-middle.mp3
https://files.samplefiles.com/edge-cases/corrupt/invalid.json
https://files.samplefiles.com/edge-cases/corrupt/malformed.xml
https://files.samplefiles.com/edge-cases/corrupt/malformed.csv
https://files.samplefiles.com/edge-cases/empty/zero-byte.pdf
https://files.samplefiles.com/edge-cases/empty/zero-byte.jpg
https://files.samplefiles.com/edge-cases/empty/zero-byte.mp4
https://files.samplefiles.com/edge-cases/empty/zero-byte.docx
https://files.samplefiles.com/edge-cases/empty/zero-byte.json
https://files.samplefiles.com/edge-cases/empty/empty-archive.zip
https://files.samplefiles.com/edge-cases/empty/header-only.csv
https://files.samplefiles.com/edge-cases/empty/blank-page.pdf
https://files.samplefiles.com/edge-cases/mislabeled/text-named.pdf
https://files.samplefiles.com/edge-cases/mislabeled/webm-named.mp4
https://files.samplefiles.com/edge-cases/mislabeled/mp3-named.wav
EOF

Truncated media

The start of each file is valid, so format detection passes; the data runs out partway through.

FileSizeDetailsDownload
Truncated JPGtruncated.jpg20.9 KBMissing the EOI marker; most viewers render the top half and grey out the rest.Download
Truncated PNGtruncated.png161 KBDownload
Truncated GIFtruncated.gif198 KBDownload
Truncated WEBPtruncated.webp9.8 KBDownload
Truncated MP4truncated.mp4532 KBDownload
Truncated MP3truncated.mp3234 KBDownload
Truncated WAVtruncated.wav861 KBDownload
Truncated FLACtruncated.flac499 KBDownload

Truncated documents and archives

A PDF missing its cross-reference table, and ZIP-based files missing their central directory.

FileSizeDetailsDownload
Truncated PDFtruncated.pdf9 KBDownload
Truncated ZIPtruncated.zip523 KBDownload
Truncated DOCXtruncated.docx19.8 KBDownload
Truncated XLSXtruncated.xlsx56.2 KBDownload
Truncated EPUBtruncated.epub34.5 KBDownload

Damaged headers and data

Overwritten signatures that defeat format detection, and damage in the middle of otherwise valid files.

FileSizeDetailsDownload
PNG with a damaged signaturebad-signature.png323 KBDownload
JPG with a damaged headerbad-header.jpg41.8 KBDownload
ZIP with a CRC errorcrc-mismatch.zip524 KBDownload
MP3 with corrupted framescorrupted-middle.mp3469 KBGlitch at about 15 seconds.Download

Malformed text formats

Syntax errors that strict parsers must reject with a useful line and column.

FileSizeDetailsDownload
Invalid JSONinvalid.json94 BDownload
Malformed XMLmalformed.xml212 BDownload
Malformed CSVmalformed.csv149 BDownload

Empty files

Zero-byte files, and valid files with nothing in them, which should not be reported as corrupt.

FileSizeDetailsDownload
Zero-byte .pdf filezero-byte.pdf0 BDownload
Zero-byte .jpg filezero-byte.jpg0 BDownload
Zero-byte .mp4 filezero-byte.mp40 BDownload
Zero-byte .docx filezero-byte.docx0 BDownload
Zero-byte .json filezero-byte.json0 BDownload
Valid empty ZIPempty-archive.zip22 B0 entriesDownload
CSV with a header and no rowsheader-only.csv30 B0 rowsDownload
PDF with one blank pageblank-page.pdf1.2 KB1 pageDownload

Not what the name says

A text file named .pdf and a WebM named .mp4: valid content, wrong type.

FileSizeDetailsDownload
Text file named .pdftext-named.pdf31 BDownload
WebM video named .mp4webm-named.mp41.7 MBDownload
MP3 file named .wavmp3-named.wav469 KBDownload