How do you prevent php from uploading files into ./tmp/ folder if they are not the correct type.
For example the sample code given on the w3school website checks the file length using the following code:
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/pjpeg"))
But this is after the files have already been uploaded to temp, am I correct? Is there any way to do this in php or will I have to do it on the client side?