Folder is placed outside of public folder, along with application.
I want to do this by controller. Please let me know if i can do this. I have tried to put index.php code in controller and pt resources folder inside the folder which i want to list but did not worked that.
Following php code is working for me(custom directory browser). Please review and let me know if we can implement it in DirectoryLister
"
public function indexAction() {
$root = dirname(APPLICATION_PATH) . '\emailLog';
$path = null;
if (isset($_GET['file'])) {
$path = $_GET['file'];
if (!file_exists($root . '\\' . $path)) {
$path = null;
} else {
$path = '/' . $path;
}
}
if (is_file($root . $path)) {
readfile($root . $path);
}
if ($path)
echo '<a href="?file=' . urlencode(substr(dirname($root . $path), strlen($root) + 1)) . '">..</a><br />';
foreach (glob($root . $path . '/*') as $file) {
$file = realpath($file);
$link = substr($file, strlen($root) + 1);
echo '<a href="?file=' . urlencode($link) . '">' . basename($file) . '</a><br />';
}
exit;
}
"