Reading a Image File in PHP

29 views
Skip to first unread message

DesertFox07

unread,
Jan 22, 2009, 10:43:29 AM1/22/09
to Connecticut PHP Developers Group - CPDG
I am creating a form for users of a site to upload images to the
server. While doing the due diligence to verify the extension on the
client side via JavaScript, I also want to assure that only image
files are uploaded to the site. What I would like to do is read the
beginning of the file for the file declartion such as "Gif89a", " PNG"
or "Jpeg", but I don't have experience reading binary files. Does
anyone know of a way to do this or a script that exists to do this?

Thanks,
-Jeff
Reply all
Reply to author
Forward
0 new messages