A voir également:
- Php : lister un dossier par nom
- Easy php - Télécharger - Divers Web & Internet
- \R php ✓ - Forum PHP
- Br php ✓ - Forum PHP
- Expert php - Télécharger - Langages
- Php echo image ✓ - Forum PHP
3 réponses
$rep=opendir($upload_dir);
while ($file = readdir($rep)) {
if($file != '..' && $file !='.' && $file !=''){
if (!is_dir($file)){
echo "<tr><td> <div align='center' class='Style5'><a href='msnup/msnspace/".$file."' target=_blank><font color='#0099FF'>$file</a> </td>";
$file_size = filesize($upload_dir."".$file);
if ($file_size >= 1048576)
{
$show_filesize = number_format(($file_size / 1048576),2) . " MB";
}
elseif ($file_size >= 1024)
{
$show_filesize = number_format(($file_size / 1024),2) . " KB";
}
elseif ($file_size >= 0)
{
$show_filesize = $file_size . " bytes";
}
else
{
$show_filesize = "0 bytes";
}
echo "<td> <div align='center' class='Style5'> $show_filesize </td></tr>";
}
}
}
closedir($rep);
while ($file = readdir($rep)) {
if($file != '..' && $file !='.' && $file !=''){
if (!is_dir($file)){
echo "<tr><td> <div align='center' class='Style5'><a href='msnup/msnspace/".$file."' target=_blank><font color='#0099FF'>$file</a> </td>";
$file_size = filesize($upload_dir."".$file);
if ($file_size >= 1048576)
{
$show_filesize = number_format(($file_size / 1048576),2) . " MB";
}
elseif ($file_size >= 1024)
{
$show_filesize = number_format(($file_size / 1024),2) . " KB";
}
elseif ($file_size >= 0)
{
$show_filesize = $file_size . " bytes";
}
else
{
$show_filesize = "0 bytes";
}
echo "<td> <div align='center' class='Style5'> $show_filesize </td></tr>";
}
}
}
closedir($rep);