I am working with the upload and reading of a spreadsheet file and I want to check that its type is correct, according to the php documentation the key type
of the global variable $_FILES
$_FILES['fichero_usuario']['type']
The MIME type of the file, if the browser provided this information. An example would be "image / gif". This MIME type, without However, it is not checked on the PHP side and therefore does not Guarantees its value.
Which means that the browser does not assure us the correct mime and it is not good to trust it. The question is how to get the right type of mime type because I have seen several functions of the php to do it as mime_content_type
and it happens that these functions receive the actual file path (which I do not have, because I only read the file but not I upload it to the server), I just have the file path temp
that returns $_fILES
. Does anyone know how to achieve this? I remain in any doubt.