getPath() on 5.7.3

Permalink
I change code from 5.6 to 5.7

My Image block have bellow it on 5.6
$f = File::getByID($this->fID);
$fullPath = $f->getPath();
In 5.7.3
following error occur.

call_user_func_array() expects parameter 1 to be a valid callback, class 'Concrete\Core\File\Version' does not have a method 'getPath'

How shuld I do?

tomoac
View Replies:
Trebxuor replied on at Permalink Reply
Trebxuor
The "Version.php" file in Concrete 5.7.3 contains the following methods that you could try for this:

public function getRelativePath()

public function getURL()

I think "getURL()" is the one you are looking for so try something like this:
$f = File::getByID($this->fID);
$fullPath = $f->getURL();
tomoac replied on at Permalink Reply
tomoac
Thank you. But I want to get fullpath.

getURL() is URL string.

getRelativePath() is relative path

How do I get full path on server.
Blade83 replied on at Permalink Reply
Blade83
I meaning this

BASE_URL.DIR_REL.$f->getRelativePath()
Blade83 replied on at Permalink Reply
Blade83
I meaning this

BASE_URL.DIR_REL.$f->getRelativePath()
urodba replied on at Permalink Reply
Perhaps

$filePath = $_SERVER['DOCUMENT_ROOT'].File::getRelativePathFromID( $id);