Okay so the code is able to generate the files but I have a problem with files that are saved with space...when user clicks on the link it says page not found...example a file with a filename of "research proposal" gives the error Not Found The requested URL /simpleblog/kcfinder/upload/files/ was not found on this server....pretty sure its because of the space..
(-3-)
<?php
// directory path can be either absolute or relative
$dirPath = '../kcfinder/upload/files';
echo "<h1>DATA FILES</h1><hr>";
// open the specified directory and check if it's opened successfully
if ($handle = opendir($dirPath)) {
// keep reading the directory entries 'til the end
while (false !== ($file = readdir($handle))) {
// just skip the reference to current and parent directory
if ($file != "." && $file != "..") {
if (is_dir("$dirPath/$file")) {
// found a directory, do something with it?
echo "<a href=".$dirPath."/".$file.">$file<br></a>";
} else {
// found an ordinary file
echo "<a href=".$dirPath."/".$file.">$file<br></a>";
}
}
}
// ALWAYS remember to close what you opened
closedir($handle);
}
?>