Closed
Description
Symfony version(s) affected: 5.*
Description
With php 8 finfo
returns application/csv
as mime type for csv files and this mime type is not supported in guessExtension
so it returns null
.
With php 7.4 csv files are recognized as text/plain
and the guessed extension is txt
.
How to reproduce
Try with php 8:
$mime = MimeTypes::getDefault()->guessMimeType('path/to/csv_file.csv');
$extension = MimeTypes::getDefault()->getExtensions($mime);
echo $mime;
echo $extension;
Possible Solution
Add 'application/csv' => ['csv']
to MimeTypes
extensions map