mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
Fix bad mimetype when importing csv from a windows computer
This commit is contained in:
parent
b12738073b
commit
cafe210f69
2 changed files with 15 additions and 2 deletions
|
@ -214,6 +214,7 @@ namespace controllers\internals;
|
|||
'content' => 'Une erreur inconnue est survenue.',
|
||||
'error_code' => $file['error'] ?? 99,
|
||||
'mime_type' => false,
|
||||
'extension' => false,
|
||||
];
|
||||
|
||||
if (UPLOAD_ERR_OK !== $file['error'])
|
||||
|
@ -265,7 +266,8 @@ namespace controllers\internals;
|
|||
return $result;
|
||||
}
|
||||
|
||||
$result['mime_type'] = 'text/plain' === mime_content_type($tmp_filename) ? $file['type'] : mime_content_type($tmp_filename);
|
||||
$result['extension'] = pathinfo($file['name'])['extension'];
|
||||
$result['mime_type'] = mime_content_type($tmp_filename);
|
||||
|
||||
$file_handler = fopen($tmp_filename, 'r');
|
||||
$result['success'] = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue