[eluser]Mirage[/eluser]
The Good
Open config/mimes.php, find the csv extension (around line 13) and add 'text/x-csv' to the array and viola. You're in business.
The Bad
The problem is that the mimetype for csv files isn't resolved properly. It's not a CI bug per-se.
When browser submit a form of type 'multipart/form-data' they set a content-type header for each submitted file. This in turn is processed by PHP into the $_FILES array 'type' key.
CI validates allowed file types, by cross-referencing this 'type' key with values stored in it's own dictionary of mimes ( config/mimes.php ). Ironically - the upload class, uses the file-extension to look up the possible list of mimes.
For CSV files, FF submits a mime-type of 'text/x-csv'. Which is not listed in CI's dictionary for the 'csv' extension. Ergo - it will never be allowed.
The ugly
If you upgrade your CI environment at some point in the future, you may replace mimes.php with the distro and if this mime-type wasn't rolled into the distro, you'll have some problems and fix it again.
I really do not understand WHY CI insists on using mime-types for comparison, especially when 'allowed_types' is a set of of extensions. Clearly, the browsers determine mime-type by extension. So simply testing the extension would suffice. Whether a gif is actually a gif or a csv is a csv can't be proven in either case. But one thing is a given: THE FILE EXTENSION. No guessing there.
It's simply confusing to be allowing a type by extension, but having the actual validation happen against something else. I'd vote for the validation to happen against the extension, as collinbird implemented with his class override. I just hate modifying the core for these 'fix' things. That's not what class extension are meant to be for. And it's increasingly hard to track all the 'fixes' across CI releases. Frustrating actually.
In all fairness, FF doesn't impress me either with yet another mime-type for csv. Just have a look at the list of mimes already put into CI. Good Lord! Mimes are no more accurate or predictable than extensions.
Cheers,
m