Search packages, repositories and app categories

Package detailsv2.1.0

file_magic_number

A Flutter package to detect file types based on their magic number instead of MIME types. Supports Flutter on mobile, desktop, and web without native code.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
8.2K
Likes
28
Pub points
150

Install package

flutter pub add file_magic_number

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

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

Categories

Dependencies

Dependency list 3 items

Projects using this package