API to get fullpath in dataroot

Re: API to get fullpath in dataroot

by Ângelo Rigo -
Number of replies: 0

Hi 

I just extract the url of the image (from a question title) and use the TCPDF Image method:

$questiontitle = $question->questiontext;
$imgpos = strpos($questiontitle, 'src');
$urlimage = "";
if($imgpos != false) {
$imageurl = substr($questiontitle, $imgpos+5);
$endpos = strpos($imageurl, '"');
$imageurl = substr($imageurl, 0, $endpos);
}
if($imageurl != ""){
$doc->Image($imageurl, $absx, $absy, 0, 0, '', '', 'T', false, 100, '', false, false, 1, false, false, false);

}

Can i use get_file_storage and get_file from an image url ?