The above TS setup works perfect until 6.1. Since 6.2 the publicUrl function in \Core\Resource\Driver\LocalDriver::getPublicUrl()
encodes the file name with rawurlencode().
This might be intended, but if the file name or path contains whitespaces, the image file will not be rendered, because the encoded filepath cannot be found in the filesystem:
In \TYPO3\CMS\Core\Resource\ResourceFactory::retrieveFileOrFolderObject()
the file cannot be found ($input holds the rawurlencoded filepath for the given TS setup).
// e.g. $input = 'fileadmin/user_upload/filename%20with%20whitespaces.jpg'
$input = \TYPO3\CMS\Core\Utility\PathUtility::getCanonicalPath(ltrim($input, '/'));
if (@is_file(PATH_site . $input)) {
// only the local file
return $this->getFileObjectFromCombinedIdentifier($input);
}
It's not clear to me, if getCanonicalPath()
should remove the urlencoding, if the encoding should be removed inbetween or if LocalDriver::getPublicUrl() should not encode the url at all.
I also proposed to use this alternative TS setup:
file.import.data = file:current:localPath
Unfortunately this will create a temporary file with ugly filename instead of using the original file (e.g. "typo3temp/fal-tempfile-wHoMB2.jpg"), which is absolutely unacceptable with regard to ranking optimized filenames.