My Rails site allows users to upload documents, I am using the attachment_fu plugin. I have a list of allowed [MIME] content types that I allow - the standard image formats, Office documents, PDF, etc. I have a user who cannot upload any PDF documents because the validation fails, looking in the logs attachment_fu thinks the MIME type is "application/x2x-download". The users browser is Firefox on Windows XP. When I try to upload the PDF myself using Firefox on OS X or Safari or IE 6/7/8 it works just fine. Seems to just be an issue with her browser.
I googled around for this MIME type and it seemingly doesnt exist.
In theory, I could ignore the MIME type that the client is telling and attempt to identify the file myself, maybe shell out to the file -b --mime-type
command, but this just seems janky.
The other popular Rails attachment plugin, Paperclip, does not do the MIME identification itself and also attempts to trust the client browser.
What do you y'all think? Ignore the client and [attempt to] identify the upload myself or try to figure out why this users browser is setting a totally invalid MIME type in the first place?