I'm uploading the first 10KB of the file and identifying that on the backend - from experimentation, 10KB is enough to identify most common files.  Flash lets you do this easily, whereas I'm not aware of any other web technology that would allow me to do it at all.