Making sure a .jpg is infact a .jpg

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
RecoilUK
Forum Commoner
Posts: 30
Joined: Sun Feb 29, 2004 7:13 pm

Making sure a .jpg is infact a .jpg

Post by RecoilUK »

Hi guys

Say you want to allow users to upload a .jpg onto your server.

Is there a way of automatically inspecting the file, firstly to make sure sure it is indeed a picture, secondly to make certain its of a particular size(x,y coordinates, not filesize) and to make sure its not a virus (if they can contain viruses, which I dont think they can).

Look forward to your responses.

Thanks guys
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Use [php_man]getimagesize[/php_man]();


feyd | made function name a link ;)
Post Reply