Hi.
Why not use the file functions in PHP?
I'm using this to display a list of pdf files via a website...
functions:
function func_generate_filelist($arg_path, $arg_pattern){
$var_search = $arg_path . $arg_pattern;
$arr_filelist = glob($var_search);
return($arr_filelist);
}
function func_wzkalk_bestaetigung($arg_requested_service, $arg_statement, $arg_condition){
if($arg_requested_service == 'pdf_list'){
// Suchen nach dem vom Aufruf übergebenen Muster für Dateinamen in dem ebenfalls übergebenen
// Unterverzeichnuispfad
// Achtung, ein Teil des Pfades kommt vom Aufruf!
$var_path = $_SERVER['DOCUMENT_ROOT'].$arg_statement;
$arr_filelist = func_generate_filelist($var_path, $arg_condition);
for($counter_filelist = 0; $counter_filelist < sizeof($arr_filelist); $counter_filelist++){
$arr_current_pathinfo = pathinfo($arr_filelist[$counter_filelist]);
$arr_indicator = explode("-", $arr_current_pathinfo["basename"]);
if(in_array("ABW", $arr_indicator)){
echo "ABW: <a href='" .$arr_current_pathinfo["basename"]. "' target='_blank'> " . $arr_current_pathinfo["basename"] . "</a><br>";
}elseif(in_array("WZB", $arr_indicator)){
echo "WZB: <a href='" .$arr_current_pathinfo["basename"]. "' target='_blank'> " . $arr_current_pathinfo["basename"] . "</a><br>";
}
}
return(true);
}
}
function call: searching for PDFs only
<?php
// Liste der pdfs -> pfad: von document root weg
func_wzkalk_bestaetigung('pdf_list', '/path_name/', '*.pdf');
?>
No need to mess with serverwide settings this way and you can disclose file types as you need them instead of simply putting out everything.
I copied the thing here as I use it, so you'll have to modify the thing, but basically it works. If you something souldntwork for you however, post it and I'll correct the stuff so I does work for you as well.
greetings, jakob