Project

General

Profile

Actions

Feature #60019

closed

Create utility function to get the file mimetype depending on available php modules

Added by Sascha Egerer over 10 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
Start date:
2014-07-01
Due date:
% Done:

100%

Estimated time:
PHP Version:
5.5
Tags:
Complexity:
Sprint Focus:

Description

TYPO3 does currently use finfo_file to get the mime type of a file. This does only work if the finfo module is loaded in PHP.
dkd is currently working with Microsoft to get TYPO3 working in the Microsoft Azure Web Gallery and there is no finfo module installed by default.

To get this code a little bit more portable there should be a wrapper function that checks if the finfo exsists and if not use mime_content_type.


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #85641: mimeTypeGuessers hook of FileInfo is brokenClosedAndreas Kienast2018-07-25

Actions
Has duplicate TYPO3 Core - Task #46777: Improve behaviour when mime type detection is missingClosed2013-03-29

Actions
Precedes TYPO3 Core - Bug #64929: Fix filesize Unittest on windows with CRLFClosed2015-02-08

Actions
Actions #1

Updated by Gerrit Code Review over 10 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/31256

Actions #2

Updated by Gerrit Code Review over 10 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/31256

Actions #3

Updated by Gerrit Code Review over 10 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/31256

Actions #4

Updated by Ingo Schmitt almost 10 years ago

  • Category set to File Abstraction Layer (FAL)
Actions #5

Updated by Sascha Egerer almost 10 years ago

  • Target version set to next-patchlevel
  • Sprint Focus set to On Location Sprint
Actions #6

Updated by Gerrit Code Review almost 10 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/31256

Actions #7

Updated by Gerrit Code Review almost 10 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/31256

Actions #8

Updated by Gerrit Code Review almost 10 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/31256

Actions #9

Updated by Gerrit Code Review almost 10 years ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/31256

Actions #10

Updated by Gerrit Code Review almost 10 years ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/31256

Actions #11

Updated by Gerrit Code Review almost 10 years ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/31256

Actions #12

Updated by Anonymous almost 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #13

Updated by Stephan Großberndt almost 10 years ago

  • Tracker changed from Bug to Feature
Actions #14

Updated by Beltran Rueda over 9 years ago

I could reproduce the following issue on Windows using 7.1.0 version:

PHP Fatal error:  Class 'finfo' not found in ...\typo3\sysext\core\Classes\Type\File\FileInfo.php on line 33

Replacing the following in the FileInfo.php file fixes the issue. Could you confirm this fix is correct?

if (!function_exists('finfo_file')) {

with:

if (function_exists('finfo_file')) {
Actions #15

Updated by Wouter Wolters over 9 years ago

Hi, this has been fixed meanwhile with https://review.typo3.org/#/c/37205/

Actions #16

Updated by Anja Leichsenring almost 9 years ago

  • Sprint Focus deleted (On Location Sprint)
Actions #17

Updated by Andreas Kienast over 6 years ago

  • Related to Bug #85641: mimeTypeGuessers hook of FileInfo is broken added
Actions #18

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF