$path = '/var/www/html/my website/index.php'; $encodedPath = t3lib_div::rawUrlEncodeFP($path); echo $encodedPath;
$file = 'my image.jpg'; $folder = '/var/www/html/my website/images'; $filePath = $folder . '/' . t3lib_div::rawUrlEncodeFP($file); echo $filePath;Output: /var/www/html/my%20website/images/my%20image.jpg Description: This example shows how to encode a file name and append it to the folder path to create a complete file path for file operations. These examples are part of the TYPO3 package library.