Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 18, 2024 via composer

league/mime-type-detection 1.14.0

Mime-type detection for Flysystem
Package summary
Share
0
issues
1
license
1
MIT
Package created
26 Feb 2020
Version published
17 Oct 2023
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
league/mime-type-detection@1.14.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of league/mime-type-detection 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does league/mime-type-detection do?

The league/mime-type-detection package is a versatile and robust tool for detecting mime-types in PHP. It provides a consistent interface, making it a crucial ally in handling file uploads, downloads, or working with local files. Whether you need mime-type detection based on a file's content, its name, or a combination of both, this package has you covered. It's an essential part of the PHP League's collection and a mainstay in many PHP-based projects.

How do you use league/mime-type-detection?

To use the league/mime-type-detection package, you first need to install it using Composer:

composer require league/mime-type-detection

Usage is then pretty straightforward; you create a new instance of a detector and call the relevant methods. Depending on whether you want a detection based on file contents, file name, or both, you'd use different methods.

To detect by contents, fall back to detection by extension:

$detector = new League\MimeTypeDetection\FinfoMimeTypeDetector();
$mimeType = $detector->detectMimeType('some/path.php', 'string contents');

To detect by contents only, without extension fallback:

$mimeType = $detector->detectMimeTypeFromBuffer('string contents');

To detect by actual file, no extension fallback:

$mimeType = $detector->detectMimeTypeFromFile('existing/path.php');

To only detect by extension:

$mimeType = $detector->detectMimeTypeFromPath('any/path.php');

Where are the league/mime-type-detection docs?

The league/mime-type-detection package's documentation can be found on its GitHub page at https://github.com/thephpleague/mime-type-detection. The README file there provides a comprehensive guide on how to use the package, its features, its methods, and the contracts it offers for mime-type detection and extension lookup. It's a valuable resource for beginners and experienced developers alike who use this package.