Example #1
0
	<body>
	</body>
</html>
<?php 
} else {
    $filePaths = array();
    if (isset($_GET["grouped"])) {
        if (isset($_POST['selection'])) {
            foreach ($_POST['selection'] as $md5) {
                $filePaths[] = getPathForMD5Chain(DOWNLOADS_DIR, $md5);
            }
        } else {
            throw new Exception("No selection provided.");
        }
    } else {
        $filePaths[] = getPathFromURL();
    }
    $fileName = "";
    foreach ($filePaths as $path) {
        $fileName .= fileName($path) . ' + ';
    }
    $fileName = substr($fileName, 0, strlen($fileName) - 3);
    $dirPath = DOWNLOADS_DIR;
    $allFiles = getContentOf($dirPath);
    $dirs = array();
    foreach ($allFiles as $file) {
        $path = $dirPath . "/" . $file;
        if (is_dir($path) && !in_array($path, $filePaths)) {
            array_push($dirs, $path);
        }
    }
Example #2
0
<?php

require_once "common.php";
$filePath = getPathFromURL();
$warning = array();
if (isset($_GET['name'])) {
    $newName = urldecode($_GET['name']);
    $newPath = dirname($filePath) . "/" . $newName;
    rename($filePath, $newPath);
}
?>

<html>
	<head>
		<title>Renommage de fichier</title>
		<meta http-equiv="refresh" content="0; URL=<?php 
echo $_SERVER['HTTP_REFERER'];
?>
">
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	</head>
	<body>
	</body>
</html>
Example #3
0
    }
}
$warning = "";
set_time_limit(0);
if (isset($_GET["grouped"])) {
    if (isset($_POST['selection'])) {
        $paths = array();
        foreach ($_POST['selection'] as $md5) {
            $paths[] = getPathForMD5Chain(DOWNLOADS_DIR, $md5);
        }
        doZipGrouped($paths);
    } else {
        throw new Exception("No selection provided.");
    }
} else {
    $path = getPathFromURL();
    if (is_zip($path)) {
        doUnzip($path);
    } else {
        if (is_rar($path)) {
            doUnrar($path);
        } else {
            if (is_dir($path)) {
                doZip($path);
            } else {
                $warning = "Impossible de traiter le fichier <b>" . basename($path) . "</b>, ce n'est ni une archive ZIP/RAR ni un dossier.";
            }
        }
    }
}
?>