Giter Site home page Giter Site logo

mimey's Issues

Support php file?

I tryed:

$extension = $mimes->getExtension('text/x-php');

But return NULL value. Extensions .php are not recognized?

EDIT
I getting mimetype with $file -> getMimeType() on laravel, // text/x-php

Just a heads up

Mime types are content types. A filename does not always describe the content of a file.

I could upload a .php file and name it .jpg - your class here will think its jpeg. Maybe even let me upload it.

You can (and should) use mime_content_type() to test properly... Just letting you know :)

It returns mpga extension for a mp3 file

I'm using this class to help to process media files. But when I get the content type of a .mp3 file, it returns audio/mpeg correctly. But when doing the reverse process, it returns .mpga extension instead .mp3, wich doesn't works in iOS.

It occurs because of the order of the extensions in the mime.types file. So I was wondering if this specific order follows any critery or can be changed. If it can, I can make a PR with the changes.

question: are assertions out of scope?

Now it's easy enough to check if an extension matches a media subtype

$extension = 'mp4';
if ( $mimes->getMimeType($extension) === 'video/mp4' ) {
    // ...
}

Would you consider a PR to extend support for asserting media supertypes?

e.g.

$extensions = [
    'mp4',
    'avi',
    'mkv',
];

foreach ( $extensions as $extension ) {
    if ( $mimes->isMediaType('video', $extension) ) {
        // returns true
    }
}

I understand that this is encroaching on the fringes of this lib's scope, but because it's such a standard use case, I was curious if you'd be open to it?

thanks

PHP8 support needed!

Hello! How about php8 support?
My lib has dependency of yours ralouphie/mimey ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.