Auto file type check