Add additional means of discovering file type on file upload. Merge master.