Skip to content

[HttpFoundation] Unable to get Numbers file mime type #18441

@SteveEdson

Description

@SteveEdson

Mime Type Issue for Numbers File

Steps to reproduce

  1. Open Numbers (an Excel-like app for Mac)
  2. Create a file with any content
  3. Export as Excel

Code to reproduce

<?php

use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser;

require "vendor/autoload.php";

$guess = MimeTypeGuesser::getInstance();

$result = $guess->guess('test-numbers.xlsx');

var_dump($result); // Outputs as `string(24) "application/octet-stream"`

Expected result

$ exiftool test-numbers.xlsx 
ExifTool Version Number         : 10.11
File Name                       : test-numbers.xlsx
Directory                       : .
File Size                       : 481 kB
File Modification Date/Time     : 2016:04:05 09:45:17+01:00
File Access Date/Time           : 2016:04:05 09:48:55+01:00
File Inode Change Date/Time     : 2016:04:05 09:45:17+01:00
File Permissions                : rw-r--r--
File Type                       : XLSX
File Type Extension             : xlsx
MIME Type                       : application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Zip Required Version            : 20
Zip Bit Flag                    : 0
Zip Compression                 : Deflated
Zip Modify Date                 : 2016:04:05 09:45:08
Zip CRC                         : 0xe3a39e9d
Zip Compressed Size             : 228
Zip Uncompressed Size           : 587
Zip File Name                   : _rels/.rels

Expected the mime type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Currently affecting laravel/framework#12914

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions