Get image src by ID

Permalink
Can't find this basic thing in documentation. HALP. =(
My C5 version is 8.2.0.

 
ramonleenders replied on at Permalink Best Answer Reply
ramonleenders
<?php
$yourFile = File::getByID(1234);
$yourFileSrc = is_object($yourFile) ? $yourFile->getURL() : false;
?>


The "$yourFileSrc" variable should either be a string to the location or be a boolean (false) if the file could not be found.

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.