1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| if(!ftp_is_dir($dir))
{
if (!@filesize($ftp, $dir) == -1)
{
//ftp_get($ftp, $local_file, $dir, FTP_BINARY);
/*$Fichier_a_telecharger = $local_file;
$chemin = ftp_get($ftp, $local_file, $dir, FTP_BINARY);
switch(strrchr(basename($Fichier_a_telecharger), "."))
{
case ".gz": $type = "application/x-gzip"; break;
case ".tgz": $type = "application/x-gzip"; break;
case ".zip": $type = "application/zip"; break;
case ".pdf": $type = "application/pdf"; break;
case ".png": $type = "image/png"; break;
case ".gif": $type = "image/gif"; break;
case ".jpg": $type = "image/jpeg"; break;
case ".txt": $type = "text/plain"; break;
case ".htm": $type = "text/html"; break;
case ".html": $type = "text/html"; break;
default: $type = "application/octet-stream"; break;
}
header('Content-type:force-download');
header('Content-Disposition: attachment; filename='.$Fichier_a_telecharger);
readfile($chemin);*/
//echo ("<a href=\"ftp://$login:$pwd@$host:$port/$dir\">Télécharger $dir</a>");
/*if (ftp_get($ftp, $local_file, $dir, FTP_BINARY))
{
echo "Le fichier $local_file a été enregistré\n";
} else {
echo "Il y a un problème\n";
}*/
}
}else
{
echo ("<a href=\"#\" onclick=\"Rename('".$fichier."')\">Renommer le dossier</a> ");
echo("<a href=\"#\" onclick=\"confirme('".$fichier."')\">Supprimer</a> ");
echo("<a href='?fichier=".htmlspecialchars($fichier, ENT_QUOTES, 'ISO-8859-1')."'>$local_file</a>"."<br/>");
} |
Partager