image - Validate that a file is a picture in PHP -


If a file is uploaded to the server, then to ensure that it is actually a picture and not, Is there a way to use PHP with just a file .jpg or .gif extension?

using the GD library (part)

  The outline of the array (string $ filename [, array and $ imageinfo])  

The first element of the array if there is no image then it would be 0.

If you do not have GD installed (most of the time you will do), then you can read the file header.

EDIT: In fact, Neil told in the comment, "Strong" does not require GD library to use this function. Therefore use it.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -