I'm trying to get the filesize() of a file based on a retrieval of filename from the database. The file is located in the download directory and the code calling the function is in the root of the website. Here's the code I've tried:
$test = $pdo->query("SELECT filename FROM files WHERE id =1");
$isoname = $test->fetchColumn();
$test = "download/".$isoname;
$isosize = filesize($test)/1000000;
It always returns zero although is returns the correct filename.
Thanks for any guidance in advance.