I tested this code and it works in IE8, FF3.6 and Google Chrome, if I upload a Word-file with the extension .doc.
A few unsollicited pointers:
- It’s really none of my business, but why would you want to specify ‘allowed_types’ if you’re going to allow all kinds of dangerous files like php and exe anyway? Allowing php files to be uploaded is highly insecure! A user could upload a script that deletes all files in you webroot, or your entire database.
- You call an undefined variable $upload_error in your view, which throws an error. (Message: Undefined variable: upload_error)
- Try not to use short open tags, it makes your app less portable