Hi, Tuesday, July 30, 2002, 3:52:23 AM, you wrote: D> maybe it would be easier to show you the part of code I'm using,
D> } D> /** Check for the type of the image : only allow jpeg's */ D> if($_FILES['uploadFile']['name']['type']!="image/jpeg"){ D> echo "You can only upload jpg images."; D> exit(); D> } D> The one above is the one I'm having problems with, it should work by looking D> at it, it all makes sense, but it won't for some strange reason. I heard D> there is a difference in browsers to get it to work at time, so I tried D> using pjpeg instead and got the same result. If I can't get this to work D> somehow then I will be trying your method Oscar, which just means I'll have D> to change the code for it all, no big deal it's not much of a change anyhow, D> if it was pages upon pages then it would be lol. D> Thanks for all your help guys, and the security issue I never even realized, D> so I guess I'll have to go hunting for away to resolve that too if I'm going D> to use it for all users instead of administration uploading. D> Your help is much appreciated D> Sam Try it this way, it will check if it is a jpeg and it has a horizontal and vertical size so you can be pretty sure it is an image file. (you do not need the gd package for getimagesize()) /** Check for the type of the image : only allow jpeg's */ $im = getimagesize($_FILES['uploadFile'); if(!($im[2] == 2 && $im[0] > 0 && $im[1] > 0)){ echo "You can only upload jpg images."; exit(); } -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php