You're better off using the actual files API: do something like `$('.file-input').get(0).files` and introspect what you get. It's a much nicer API than what you've hacked together here. :)