#99404Invalide relative path given by getPublicUrl()
Description
On a FileReference, if you try to get the public Url with :
$myFile->getOriginalResource()->getPublicUrl()
you get a relative URL like this :
> ‘/uploads/tx_myext/MyTestFile.pdf’
but this URL is prefixed with a slash and then cannot be used with functions like fopen()
Before TYPO3 V11, the method getPublicUrl() return a path like this :
> ‘uploads/tx_myext/MyTestFile.pdf’
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 3
-
Christoph Lehmann commented 12/23/22, 21:18
-
Florian Rival commented 12/27/22, 09:26
Thanks for you answer.
In my case, it works with that :
$myFile->getOriginalResource()->getForLocalProcessing();You can close this issue.
-
Chris Müller changed status
NewClosed 01/05/23, 14:04
If you wanna work with a file in the filesystem, then you can do it like this
getPublicUrl() returns a publicly accessible URL for this file and it is not meant to be used in filesystem context.
Is it okay to close the issue for this reason?