Overview
A Flutter package that identifies file types by analyzing their magic numbers—unique byte sequences at the beginning of files—rather than relying on MIME types or file extensions. It works across all platforms including mobile, desktop, and web without requiring native code. This approach ensures accurate file detection even when metadata is missing or misleading. The package is lightweight, easy to integrate, and ideal for applications needing reliable file type recognition.
Use cases
- File upload validation
- Media file detection
- Secure file handling
- Cross-platform file analysis
- Automated file categorization
Key features
- Magic number-based detection
- No native code required
- Supports all Flutter platforms
- Lightweight and fast
- Accurate file type identification
Suitable for
- Developers building file-heavy apps
- Apps requiring secure file processing
- Cross-platform file utilities
- Tools needing robust file type detection
Considerations
- May not detect all obscure file formats
- Relies on known magic number database
- Limited to header-based identification only