Dev
Fake File & MIME Type Dataset Generator
File upload endpoints, media libraries, and asset-tracking databases all need test fixtures with realistic file metadata — not just random strings. This generator produces mock file records with accurate filenames, byte-range sizes, correct MIME types, MD5-formatted checksums, and modification dates, mirroring what a cloud storage API like S3 ListObjectsV2 actually returns. Two inputs control output. Count (1–30) sets how many records you need. The category filter narrows MIME types: images (jpg, png, gif, webp, svg), documents (pdf, docx, xlsx, txt, csv), audio (mp3, wav, ogg, flac), video (mp4, webm, mov, avi), code (js, ts, json, html, css, py), or mixed for a general-purpose bucket. MIME types always match their file extension within a record. Sizes range from 512 bytes to ~50 MB, covering realistic distributions across all supported categories.
How to use
- Choose your options above
- Click Generate
- Copy your result
Detailed instructions
- Set the Number of Files count to match how many records your test scenario or database fixture needs.
- Choose a File Category from the dropdown — pick a specific type like 'images' or 'documents', or 'mixed' to simulate a general-purpose bucket.
- Click Generate to produce the file records, each containing a filename, size, MIME type, MD5 checksum, and modification date.
- Copy the output and paste it directly into your test fixture file, database seed script, or API mock handler.
- If you need a different distribution of file types, run the generator multiple times with different categories and combine the results.
Use Cases
- •Mocking S3 ListObjectsV2 responses in Jest by mapping filename, size, and checksum to the Contents schema
- •Seeding a file_metadata Postgres table with varied MIME types across images, audio, and documents
- •Driving Cypress tests for a file manager UI that renders thumbnails, labels, and size badges
- •Testing server-side upload validation that rejects MIME type and file extension mismatches
- •Populating Storybook stories for a media library component with realistic filenames and byte sizes
Tips
- →For database seeding, generate separate batches per category so you can control the ratio of images to documents to video in your test data.
- →When testing MIME validation rejection, generate a batch then manually swap one MIME type to mismatch its extension — the surrounding valid records provide realistic context.
- →Pair video or audio records with large file sizes when testing upload progress or chunked transfer logic, since unrealistically small sizes hide edge cases.
- →If your storage system enforces unique filenames, append the MD5 checksum's first eight characters to each name as a suffix before inserting into your database.
- →Use the code file category specifically when testing syntax-highlighting file managers or code repositories — the extensions map to real language MIME types.
- →Mixed-category output works best for testing sort-by-type and filter features, since it guarantees multiple MIME type groups appear in a single dataset.
FAQ
how to mock an S3 ListObjectsV2 response with fake file metadata
Generate a mixed or category-specific set, then map each record to the S3 Contents schema: filename becomes Key, size maps to Size, the date to LastModified, and the checksum to ETag (wrap it in quotes as S3 does). This gives you a structurally valid mock payload without needing a real bucket or AWS credentials.
are the MD5 checksums valid enough to use in tests
They are correctly formatted 32-character hex strings, so any code that stores, displays, or structurally compares hashes will handle them without errors. They are not computed from real file content, meaning they won't verify against actual files — but for deduplication UI, integrity-check endpoints, or seed scripts, they work exactly as needed.
do the mime types actually match the file extensions in the output
Yes — every record pairs the file extension with its correct MIME type: .png always carries image/png, .pdf carries application/pdf, .mp3 carries audio/mpeg. If you want to test rejection logic for mismatched types, generate the set and manually swap one MIME type after copying.
what file size range does the generator produce
Sizes are randomly generated between 512 bytes and approximately 50 MB. The output displays size in kilobytes with one decimal place. This range covers the typical spectrum from small thumbnails and config files to large audio and video assets, making it suitable for testing upload size limits and storage quota calculations.
You might also like
Popular tools from other categories that share themes with this one.
Try these next
More free tools from other corners of the catalog, picked by shared themes.