Beispiel #1
0
     }
     $s = "lang.extracted+' " . $info["dir"] . " '+lang.folder+' '+lang.and+' " . $info["file"] . " '+lang.file+lang.br";
     $s .= "+lang.orig_file+lang.size+' " . dealsize($info["orig_size"]) . " '+lang.extract+lang.file+lang.size+' " . dealsize($info["size"]) . "'";
     $s .= $errors ? "+lang.br+lang.error+':'+lang.br+'{$errors}'" : "";
     exitme($eval . "notice({$s})", "eval");
 } else {
     if ($action == "zippack" && $user["zippack"]) {
         $sfile = urldecode1($_POST["sfile"]);
         $sdir = urldecode1($_POST["sdir"]);
         if (!is_writeable($path)) {
             exitme("notice(lang.cannot_write)", "eval");
         }
         if (strtolower(substr($key, -4)) != ".zip") {
             $key .= ".zip";
         }
         if (@file_put_contents($path . $key, zippack($path, $sdir, $sfile))) {
             exitme("notice('{$key} '+lang.compress+lang.success);reloaddata();", "eval");
         } else {
             exitme("notice('{$key} '+lang.compress+lang.fail)", "eval");
         }
     } else {
         if ($action == "property") {
             if (!is_dir($path)) {
                 exitme("notice(lang.not_found)", "eval");
             }
             $info = $lb->get_property($path);
             $s = "lang.here+':\t{$path}<br/>'+lang.br";
             $s .= "+lang.folder+':\t" . $info["dir"] . "<br/>'+lang.br";
             $s .= "+lang.file+':\t" . $info["file"] . "<br/>'+lang.br";
             $s .= "+lang.total+':\t" . dealsize($info["size"]) . "<br/>'+lang.br+lang.property+':\t'";
             $s .= $info["writable"] ? "+lang.writeable" : "+lang.not_writeable";
Beispiel #2
0
        }
    }
    $path = str_replace("|", "", $path);
    if (!file_exists($path)) {
        exit("<script>alert('文件不存在!!');</script>");
    }
    $filename = basename1($path);
    header('Content-type: application/force-download');
    header("Content-Disposition: attachment; filename={$filename}");
    header("Content-length: " . filesize($path));
    readfile($path);
    die;
} else {
    if ($action == "downfiles") {
        $sfile = urldecode($_GET["files"]);
        $sdir = urldecode($_GET["dirs"]);
        if (!($content = zippack($path, $sdir, $sfile))) {
            die("<script>alert('下载时出错!');</script>");
        }
        $filename = substr($path, 0, strlen($path) - 1) . ".zip";
        $filename = basename1($filename);
        if ($filename == "..zip" || $filename == "...zip") {
            $filename = "root.zip";
        }
        header('Content-type: application/force-download');
        header("Content-Disposition: attachment; filename={$filename}");
        header("Content-length:" . strlen($content));
        echo $content;
        die;
    }
}