How to check file

See all posts See thread Reply

Re: How to check file new!
by colin, 10 years, 5 months ago
Then it is all fine, no?

The MIME type as sent by the browser is irrelevant, and cannot be trusted.

Here, your file is an image (even tough you changed the file extension), and the class recognizes it as an image, and therefore can process it.

Isn't what you want?Reply
Re: How to check file new!
by jessica, 10 years, 5 months ago
i understand but i would like to directly print an error if extention are not jpg jpg png ,i believe its more clear because
its more décourageant si an hacker try some bad extention.
If he see successfull with an exe , i will continue to try ..
don't you think ?!Reply
Re: How to check file new!
by colin, 10 years, 5 months ago
Strictly speaking, the file is an image, even if the extension is exe

That said, if you want to prevent exe files, you can check on file_src_name_ext before calling process()Reply