Page 1 of 1

File Upload Validation

Posted: Tue Jun 16, 2009 10:00 am
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.

Re: File Upload Validation

Posted: Tue Jun 16, 2009 10:09 am
by Tobey
There is a console application called pdfinfo. The manpage looks very promising :) I Think it's part of xpdf.