application/octet-stream WTF?

December 17th, 2008

Lately I’ve been having this problem with uploaded files using the Paperclip plugin (though I don’t think it has anything to do with the plugin).

My customers are trying to upload CSV files to their Donor Tools account. Normally, when you upload a .csv file, the content type is set to “text/csv” or some variation of “text/*”.

Here’s the problem: when uploading .csv files in Windows using any version of IE or Firefox, the content type is set to “application/octet-stream”.

What the flip?

This only occurs with IE or Firefox. Safari for Windows uploads the exact same file with the content type set correctly to “text/csv”.

To get around the problem I’ve temporarily turned off the file type validation, which I don’t like because I really don’t want to be accepting uploaded binary files.

Has anyone seen this problem before? How did you deal with it?