auto-detect file types