Would it be possible to read the headers of the file to determine mimetype?