Corrupt and malformed test files for error handling — free, CC0

Most test files are meant to be read successfully. These are not. Every file under edge/ is wrong on purpose, in one declared way: empty, cut short, malformed, or carrying bytes that do not match the name and content type it is served with.

Each file is served as the type its extension claims, because that is the situation worth testing. edge/png-with-pdf-extension.pdf arrives as application/pdf and is a PNG; edge/zero-byte.zip arrives as application/zip with no bytes at all; edge/pdf-truncated-60pct.pdf reads as a PDF until it stops mid-object. Sniffing the content type from the extension, trusting a Content-Length, or assuming a parser will raise a tidy error are all mistakes these files find.

Use them on upload forms, import pipelines, thumbnailers, virus and type scanners, and anything that extracts an archive. edge/zip-directory-traversal-name.zip holds an entry named ../evil.txt: an extractor that joins entry names to a destination path without sanitising them writes outside that directory, and this file tells you whether yours does. The files are synthetic and harmless — no executable code, no real malware — so run them only against systems you are authorised to test. Related formats: PDF, PNG, ZIP, JSON, CSV.

19 files. The same list as JSON: https://loremfile.dev/edge/index.json

EDGE files
FileSizePropertiesDescription
csv-ragged-rows.csv 65 B A CSV whose rows carry different field counts: one short, one long.
Snippets
curl -O https://loremfile.dev/edge/csv-ragged-rows.csv
<a href="https://loremfile.dev/edge/csv-ragged-rows.csv">download</a>
jpg-truncated-50pct.jpg 7.5 KB The first half of jpg/640x480.jpg: scan data ends with no end-of-image marker.
Snippets
curl -O https://loremfile.dev/edge/jpg-truncated-50pct.jpg
<a href="https://loremfile.dev/edge/jpg-truncated-50pct.jpg">download</a>
json-bom.json 80 B Valid JSON preceded by a UTF-8 byte-order mark, which RFC 8259 does not allow.
Snippets
curl -O https://loremfile.dev/edge/json-bom.json
<a href="https://loremfile.dev/edge/json-bom.json">download</a>
json-trailing-comma.json 64 B JSON with a trailing comma in an array and an object: valid JavaScript, invalid JSON.
Snippets
curl -O https://loremfile.dev/edge/json-trailing-comma.json
<a href="https://loremfile.dev/edge/json-trailing-comma.json">download</a>
mp4-truncated-50pct.mp4 987.3 KB The first half of mp4/720p-5s.mp4: a partial media stream inside a box that claims more.
Snippets
curl -O https://loremfile.dev/edge/mp4-truncated-50pct.mp4
<a href="https://loremfile.dev/edge/mp4-truncated-50pct.mp4">download</a>
pdf-truncated-60pct.pdf 2.6 KB The first 60% of pdf/a4-3pages.pdf: the header reads, then the file stops mid-object.
Snippets
curl -O https://loremfile.dev/edge/pdf-truncated-60pct.pdf
<a href="https://loremfile.dev/edge/pdf-truncated-60pct.pdf">download</a>
pdf-with-png-extension.png 1.8 KB The bytes of pdf/a4-1page.pdf under a .png name, served as image/png.
Snippets
curl -O https://loremfile.dev/edge/pdf-with-png-extension.png
<a href="https://loremfile.dev/edge/pdf-with-png-extension.png">download</a>
png-with-pdf-extension.pdf 1.4 KB The bytes of png/100x100.png under a .pdf name, served as application/pdf.
Snippets
curl -O https://loremfile.dev/edge/png-with-pdf-extension.pdf
<a href="https://loremfile.dev/edge/png-with-pdf-extension.pdf">download</a>
utf8-invalid-bytes.txt 143 B Text served as UTF-8 that contains byte sequences UTF-8 does not allow.
Snippets
curl -O https://loremfile.dev/edge/utf8-invalid-bytes.txt
<a href="https://loremfile.dev/edge/utf8-invalid-bytes.txt">download</a>
xml-unclosed-tag.xml 122 B XML with an element that is never closed, so it is not well-formed.
Snippets
curl -O https://loremfile.dev/edge/xml-unclosed-tag.xml
<a href="https://loremfile.dev/edge/xml-unclosed-tag.xml">download</a>
zero-byte.csv 0 B An empty file served as text/csv, with no header row.
Snippets
curl -O https://loremfile.dev/edge/zero-byte.csv
<a href="https://loremfile.dev/edge/zero-byte.csv">download</a>
zero-byte.json 0 B An empty file served as application/json, where a parser expects at least a value.
Snippets
curl -O https://loremfile.dev/edge/zero-byte.json
<a href="https://loremfile.dev/edge/zero-byte.json">download</a>
zero-byte.mp4 0 B An empty file served as video/mp4.
Snippets
curl -O https://loremfile.dev/edge/zero-byte.mp4
<a href="https://loremfile.dev/edge/zero-byte.mp4">download</a>
zero-byte.pdf 0 B An empty file served as application/pdf.
Snippets
curl -O https://loremfile.dev/edge/zero-byte.pdf
<a href="https://loremfile.dev/edge/zero-byte.pdf">download</a>
zero-byte.png 0 B An empty file served as image/png.
Snippets
curl -O https://loremfile.dev/edge/zero-byte.png
<a href="https://loremfile.dev/edge/zero-byte.png">download</a>
zero-byte.txt 0 B An empty file served as text/plain.
Snippets
curl -O https://loremfile.dev/edge/zero-byte.txt
<a href="https://loremfile.dev/edge/zero-byte.txt">download</a>
zero-byte.zip 0 B An empty file served as application/zip, with not even an end-of-central-directory record.
Snippets
curl -O https://loremfile.dev/edge/zero-byte.zip
<a href="https://loremfile.dev/edge/zero-byte.zip">download</a>
zip-directory-traversal-name.zip 782 B A readable zip holding an entry named ../evil.txt. An extractor that joins entry names to a destination without sanitising them writes outside that directory.
Snippets
curl -O https://loremfile.dev/edge/zip-directory-traversal-name.zip
<a href="https://loremfile.dev/edge/zip-directory-traversal-name.zip">download</a>
zip-truncated-50pct.zip 911 B The first half of zip/3-text-files.zip: local headers survive, the central directory does not.
Snippets
curl -O https://loremfile.dev/edge/zip-truncated-50pct.zip
<a href="https://loremfile.dev/edge/zip-truncated-50pct.zip">download</a>

File names follow the naming grammar. Verify a download against sha256sums.txt.