I'm trying to put links to download images on my website and I also want to show the download size near the link. I'm using
<?php
$filename = base_url().'carteles/as_cartel-8.jpg';
echo filesize($filename);
?>
but I get a PHP error. I think it's because "base_url" cannot be used there. But I don't know how to get the url for filesize (which is inside my server) to manage it.
Edit:
The error is:
A PHP Error was encountered
Severity: Warning
Message: filesize(): stat failed for http://localhost/TCE/Festivales/carteles/as_cartel-8.jpg
Filename: views/categorias_v.php
Line Number: 32
Backtrace:
File: C:\xampp\htdocs\TCE\Festivales\application\views\categorias_v.php
Line: 32
Function: filesize
File: C:\xampp\htdocs\TCE\Festivales\application\views\template\template.php
Line: 5
Function: view
File: C:\xampp\htdocs\TCE\Festivales\application\controllers\categorias_c.php
Line: 22
Function: view
File: C:\xampp\htdocs\TCE\Festivales\index.php
Line: 315
Function: require_once
I do have autoload configured, I mean, base_url works fine when I try to do other stuff, my problem is when I try to use "filesize".