Dev
Fake File Metadata Generator
Building and testing file upload systems demands realistic fake file metadata that mirrors production data without the overhead of managing actual files. This fake file metadata generator creates detailed JSON objects containing file names, extensions, MIME types, byte and kilobyte sizes, MD5 and SHA-256 hash strings, and creation timestamps. Select from specific file categories — images, documents, videos, audio, or mixed — and generate between 1 and 50 records at a time to match the exact volume your test suite needs. Developers working on storage backends frequently hit a common wall: seeding a database or mocking an S3 bucket requires plausible metadata, not just placeholder strings. A realistic file size distribution, a correctly formatted MIME type, and a hash of the right length all matter when the code consuming the data validates those fields. Generating that data by hand is tedious and error-prone. This tool covers the most common file categories encountered in production systems. Images follow JPEG, PNG, GIF, and WebP conventions. Documents include PDF, DOCX, and XLSX types. Video and audio records carry appropriate codec-specific extensions and MIME types. Code file records use extensions like .js, .py, and .ts with text/plain or application/octet-stream MIME types. Switching the file category filter instantly scopes every generated record to that domain, so you can test a media library and a document manager independently without filtering output yourself. Each generated object is copy-paste ready for unit tests, Postman collections, Cypress fixtures, or database seed scripts. Because no real files are involved, there are no storage costs, no privacy concerns, and no slow file I/O during test runs.
How to Use
- Select a file category from the dropdown — choose 'Mixed' to span all types or a specific category like 'Images' to scope the output.
- Set the count field to the number of metadata records you need, between 1 and 50.
- Click Generate to produce the JSON output in the results panel.
- Copy the full JSON array or individual objects and paste into your test fixtures, seed scripts, or API mock files.
- Re-run the generator as many times as needed — each run produces a fresh set of names, sizes, and hash strings.
Use Cases
- •Seeding a media library database with realistic image metadata records
- •Mocking S3 bucket object listings for pagination and filtering tests
- •Populating Cypress or Playwright fixtures for file upload UI tests
- •Testing MIME type validation logic in a REST file upload endpoint
- •Generating Postman collection examples for a file management API
- •Stress-testing file deduplication logic using repeated hash values
- •Building demo dashboards for storage analytics with realistic file size distributions
- •Creating seed data for CMS file managers without uploading actual content
Tips
- →Generate 'Mixed' category records when testing a generic file manager; they expose MIME type handling bugs that single-category runs miss.
- →Pair image metadata records with a placeholder image service like picsum.photos by mapping the generated file name to a URL — you get plausible end-to-end mock data.
- →When testing deduplication logic, generate two separate batches and manually copy one hash from the first batch into the second to simulate a real duplicate collision.
- →Video records carry large byte sizes by design; use them specifically to test size-limit enforcement and upload progress UI components, not as general-purpose filler.
- →The ISO 8601 timestamps work directly in SQL INSERT statements — wrap them in single quotes and they'll parse correctly in PostgreSQL, MySQL, and SQLite without conversion.
- →For Postman collections, generate 6 to 8 records, paste them into a collection variable as a JSON array, and iterate with a forEach pre-request script to run the same request against multiple mock files.
FAQ
What is a MIME type and why does it matter in file uploads?
A MIME type (Multipurpose Internet Mail Extensions) is a standardized label like image/jpeg or application/pdf that tells browsers and servers what kind of data a file contains. Upload APIs use it to accept or reject files before processing. Validating MIME type on the server side — not just the extension — is a basic security requirement for any public-facing upload endpoint.
Are the generated MD5 and SHA-256 hashes real?
No. They are randomly generated hex strings of the correct length — 32 characters for MD5, 64 for SHA-256. They do not correspond to any actual file content. Use them to test hash-storage logic, deduplication lookups, or display formatting, but not for any cryptographic verification.
Can I use this output directly in a Jest or Vitest test file?
Yes. Copy the generated JSON array and paste it into a test fixture file or a mock factory. Each object already contains the fields most upload handlers expect: name, size, type, and a hash. You may need to rename 'mimeType' to 'type' if your code uses the browser File API's property naming convention.
How do I validate file types securely in a file upload API?
Check three things: the file extension, the declared MIME type in the request header, and the file's magic bytes — the first few bytes of the binary content that identify its format. Relying on extension or MIME type alone is unsafe because both can be spoofed by a client. Libraries like file-type (Node.js) or python-magic handle magic byte inspection.
What file categories can I generate metadata for?
The generator covers images (JPEG, PNG, GIF, WebP), documents (PDF, DOCX, XLSX, TXT), videos (MP4, MOV, AVI, MKV), audio (MP3, WAV, FLAC, AAC), and code files (JS, TS, PY, JSON, HTML). Selecting 'Mixed' produces a random spread across all categories, useful for testing generic file managers that handle multiple types.
How realistic are the file sizes?
Sizes are generated within ranges typical for each file category. Image files fall in the 50 KB to 8 MB range, video files in the 1 MB to 2 GB range, and documents in the 10 KB to 50 MB range. This distribution is realistic enough to surface pagination bugs, size-limit validation errors, and UI rendering issues that flat or random sizes would miss.
Can I generate metadata for a specific file extension only?
The current tool generates metadata scoped to a file category, not a single extension. To get only JPEG records, select 'Images' and filter the output by the extension field. For tighter control in automated tests, consider using one generated record as a template and programmatically overriding the extension and MIME type fields.
What timestamp format do the generated records use?
Timestamps are ISO 8601 strings (e.g., 2024-03-15T10:42:00Z), which are directly parseable by JavaScript's Date constructor, Python's datetime.fromisoformat(), and most database drivers. They represent realistic recent dates rather than the current moment, giving your seed data a natural spread.