[thelist] Validating Mime Type of Uploads

Bill Moseley moseley at hank.org
Wed Mar 28 10:36:15 CDT 2007

On Wed, Mar 28, 2007 at 04:16:26PM +0100, Jason Handby wrote:
> Randal -- assuming you want to check that people are uploading valid
> PDFs... another option would be to attempt to read them with a
> server-side PDF component, catching any exception that occurs and
> assuming this implies that the file is not a valid PDF.

Does Windows have any kind of mime-magic tools that can inspect the
upload's data?   Like the file(1) tool on unix-like systems?

$ file --mime test.pdf
test.pdf: application/pdf

Of course, that's not checking that it's actually a valid PDF or that
it can be read with any given pdf tool.

Bill Moseley
moseley at hank.org

More information about the thelist mailing list