Compare commits
No commits in common. "c2ead276dc49ae3c36d309ff6d489c1c09f7c5f8" and "b12738073b7654589527b948b90d5dee7049c3a9" have entirely different histories.
c2ead276dc
...
b12738073b
|
@ -214,7 +214,6 @@ 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'])
|
||||
|
@ -266,8 +265,7 @@ namespace controllers\internals;
|
|||
return $result;
|
||||
}
|
||||
|
||||
$result['extension'] = pathinfo($file['name'])['extension'];
|
||||
$result['mime_type'] = mime_content_type($tmp_filename);
|
||||
$result['mime_type'] = 'text/plain' === mime_content_type($tmp_filename) ? $file['type'] : mime_content_type($tmp_filename);
|
||||
|
||||
$file_handler = fopen($tmp_filename, 'r');
|
||||
$result['success'] = true;
|
||||
|
|
|
@ -302,18 +302,7 @@ namespace controllers\publics;
|
|||
break;
|
||||
|
||||
default:
|
||||
if ($read_file['extension'] === 'csv')
|
||||
{
|
||||
$result = $this->internal_contact->import_csv($id_user, $read_file['content']);
|
||||
}
|
||||
elseif ($read_file['extension'] === 'json')
|
||||
{
|
||||
$result = $this->internal_contact->import_json($id_user, $read_file['content']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$invalid_type = true;
|
||||
}
|
||||
$invalid_type = true;
|
||||
}
|
||||
|
||||
if ($invalid_type)
|
||||
|
|
Loading…
Reference in New Issue