include ("../common/public.php") ;
error_reporting(0) ;
$tipo = "fornitori" ;
/* config for the script */
$download_path = "../report"; /* path to your files, NB: no slash at the end */
$sort = "asort"; /* array sorting - alphabetical sorting for the array */
$filter = array(".php", ".bak", ".css", ".js", ".gif") ;
/* start the script... no more editing from here on... */
/* get a list of the files + dirs and turn the list into an array */
function file_list($dir)
{
global $sort;
global $file_file_count;
global $filter ;
if (is_dir($dir))
{
$fd = @opendir($dir);
while (($part = @readdir($fd)) == true)
{
clearstatcache();
if ($part != "." && (!in_array(strrchr($part,"."), $filter)))
$file_array[] = $part;
}
if ($fd == true)
closedir($fd) ;
if (is_array($file_array))
{
$sort($file_array);
$file_file_count = count($file_array);
return $file_array;
}
else
return false ;
}
else
return false ;
}
/* function to convert to Mb, Kb and bytes */
function file_size($size)
{
$megabyte = 1024 * 1024;
if ($size > $megabyte)
$re_sized = sprintf("%01.2f", $size / $megabyte) . " Mb" ;
elseif ($size > 1024)
$re_sized = sprintf("%01.2f", $size / 1024) . " Kb" ;
else
$re_sized = $size . " bytes" ;
return $re_sized;
}
$file_array = file_list("$download_path/");
$str = "