$path = 'C:\\user\\documents\\file.txt'; $fixedPath = \TYPO3\CMS\Core\Utility\GeneralUtility::fixWindowsFilePath($path); echo $fixedPath; // Output: C:/user/documents/file.txt
$path = '\\server\share\folder\file.txt'; $fixedPath = \TYPO3\CMS\Core\Utility\GeneralUtility::fixWindowsFilePath($path); echo $fixedPath; // Output: /server/share/folder/file.txtIn this example, the Windows file path "\\server\share\folder\file.txt" contains a UNC (Universal Naming Convention) pathname. The fixWindowsFilePath method converts the path to a Unix-style path by replacing backslashes with forward slashes and adding a leading slash to indicate that it is an absolute path. The resulting fixed path is "/server/share/folder/file.txt". Package Library: TYPO3\CMS\Core\Utility\GeneralUtility