[thelist] Validating Mime Type of Uploads

Randal Rust randalrust at gmail.com
Wed Mar 28 09:05:28 CDT 2007


Not quite sure how to work this one. I am working on a custom-build
CMS on a box that does not have MS Office or Acrobat installed. I am
trying to do form uploads, and one of the things I do is validate that
the MIME type is correct.

When I upload either an XLS or PDF, the MIME type is coming back as
applications/octet-stream, instead of application/msexcel or
application/pdf.

I ran into this problem once before with PDF uploads on a laptop, so I
just installed Acrobat and then it worked fine.

But this can't be the only solution.

I checked the Apache mime.types file and applciation/pdf is in there.
Yet the file type is still octet-stream when I check the
$_FILES['fileToUpload']['type'].

-- 
Randal Rust
R.Squared Communications
www.r2communications.com



More information about the thelist mailing list