J
J
JackShcherbakov2018-02-16 15:31:22
PHP
JackShcherbakov, 2018-02-16 15:31:22

What does this phrase mean in the documentation?

Hello! I am studying uploading files to the server and came across this phrase in this article :


$_FILES['userfile']['type']
The mime type of the file, in case the browser provided such information. An example would be "image/gif". This mime type is not checked on the PHP side, so don't rely on its value without checking.

How can this MIME type be checked if it is not checked on the PHP side? How to check it on the client? And how will check on the server?
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2018-02-16
@JackShcherbakov

The documentation says that you should not rely on and use information from $_FILES['userfile']['type'] for serious checks, but you should determine the MIME type of the file yourself, for example, using the mime_content_type function

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question