File Upload Validation

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
User avatar
The_Anomaly
Forum Contributor
Posts: 196
Joined: Fri Aug 08, 2008 4:56 pm
Location: Tirana, Albania

File Upload Validation

Post by The_Anomaly »

I'm working on an Intranet site where the users are permitted to upload Microsoft Office files and PDFs. If the Mime-Type is unreliable, then how can I verify that these files are, in fact, legit? If they were images, I'd attempt to open them with a GD function, to test if they are truly images--but I'm not sure what I can do with other types.
Tobey
Forum Newbie
Posts: 12
Joined: Thu May 14, 2009 11:40 am
Location: Germany

Re: File Upload Validation

Post by Tobey »

There is a console application called pdfinfo. The manpage looks very promising :) I Think it's part of xpdf.
Post Reply