auto-detect file extensions