Beispiel #1
1
function ___sendfile()
{
    $i = 0;
    $to = func_get_arg(0);
    $fs = func_get_arg(1);
    if (!is_file("email.php")) {
        return false;
    } else {
        require "email.php";
    }
    if ($to == "" || !is_array($fs)) {
        return false;
    } elseif (count($fs) < 1) {
        return false;
    }
    $systags = uniqid("");
    $subject = "your files";
    $headers = "Content-Type: multipart/mixed; boundary=\"{$systags}\"\r\n";
    $emailbody = "--{$systags}\r\n";
    $emailbody .= "Content-type: text/plain; charset=utf-8\r\n";
    $emailbody .= "Content-transfer-encoding: 8bit\r\n\r\n";
    while ($i < count($fs)) {
        if (!is_file($fs[$i]) || !is_readable($fs[$i])) {
            continue;
        }
        $attachment = chunk_split(base64_encode(file_get_contents($fs[$i])));
        $emailbody .= "--{$systags}\r\n";
        $emailbody .= "Content-type: application/octet-stream; name=" . ___basename($fs[$i]) . "\r\n";
        $emailbody .= "Content-transfer-encoding: base64\r\n\r\n";
        $emailbody .= "{$attachment}\r\n\r\n";
        $i++;
    }
    $emailbody .= "--{$systags}--";
    return email($to, "From Aite.me File Manager", $emailbody, $headers);
}
Beispiel #2
0
<?php

require "config.php";
if (!isset($_GET['path'])) {
    header("Location: ./404.php");
    exit;
} elseif (($path = trim($_GET['path'])) == "") {
    header("Location: ./404.php");
    exit;
} elseif (!is_file($path) || !is_readable($path)) {
    header("Location: ./404.php");
    exit;
} else {
    $myfs = new filesystem($path);
    $info = $myfs->getpath();
    header("Content-Type: application/force-download");
    header("Content-Disposition: attachment; filename=" . ___basename($path));
    header("Accept-Ranges: bytes");
    header("Content-Length: " . $info['size']);
    $fp = fopen($path, "rb");
    while (!feof($fp)) {
        echo fread($fp, 4096);
    }
    fclose($fp);
}
Beispiel #3
0
         if (is_link($tmp)) {
             echo "[&nbsp;Link&nbsp;-&gt;&nbsp;" . readlink($tmp) . "&nbsp;]";
         }
         echo "(<a href=\"./rename.php?path=" . urlencode($tmp) . "\">命名</a>|<a href=\"./autocp.php?path=" . urlencode($tmp) . "\">复件</a>)\n";
         echo "</div>\n";
     }
 }
 if (count($data[1]) != 0) {
     echo "\n<div class=\"like\">文件列表</div>\n";
     foreach ($data[1] as $tmp) {
         $filesystem->chpath($tmp);
         $iget = $filesystem->getpath();
         echo "<div class=\"love\">\n";
         echo "<input type=\"checkbox\" name=\"flist[]\" value=\"" . urlencode($tmp) . "\" {$select}/>\n";
         echo ($perms = $filesystem->getperms()) == false ? "[????]" : "[{$perms}]";
         echo "<a href=\"./file.php?path=" . urlencode($tmp) . "\">" . ___basename($tmp) . "</a>(" . ___filesize($iget['size']) . ")\n";
         echo "<br />\n";
         echo "<a href=\"./dget.php?path=" . urlencode($tmp) . "\">下载</a>|";
         if ($mime = ___getmime($tmp, 'png:jpg:gif:bmp:zip')) {
             if ($mime == 'application/zip') {
                 echo "<a href=\"./unzip.php?path=" . urlencode($tmp) . "\">解压</a>";
             } else {
                 echo "<a href=\"./dget.php?mime=" . urlencode($mime) . "&amp;path=" . urlencode($tmp) . "\">打开</a>";
             }
         } else {
             echo "<a href=\"./view.php?path=" . urlencode($tmp) . "\">查看</a>";
         }
         echo "|<a href=\"./editor.php?path=" . urlencode($tmp) . "\">编辑</a>|<a href=\"./rename.php?path=" . urlencode($tmp) . "\">命名</a>|<a href=\"./autocp.php?path=" . urlencode($tmp) . "\">复件</a>|<a href=\"./autopk.php?path=" . urlencode($tmp) . "\">压缩</a>\n";
         if (is_link($tmp)) {
             echo "<br />\n链接指向&nbsp;:&nbsp;" . readlink($tmp) . "\n";
         }
Beispiel #4
0
<?php

require "config.php";
if (!isset($_GET['gopath']) || !isset($_SESSION['flist']) || !file_exists("pclzip.php")) {
    header("Location: ./404.php");
    exit;
}
if (!isset($_GET['getcwd'])) {
    $getcwd = OPEN;
} else {
    $getcwd = ___realpath(trim($_GET['getcwd']));
}
xhtml_head("文件压缩");
if (count($_SESSION['flist']) < 1) {
    echo "<div class=\"error\">\n";
    echo "[<a href=\"./index.php?path=" . urlencode($getcwd) . "\">返回</a>]抱歉,文件清单为空!\n";
    echo "</div>\n";
} else {
    require "pclzip.php";
    $pkzip = new pclzip($gopath = trim($_GET['gopath']));
    echo "[<a href=\"./index.php?path=" . urlencode($getcwd) . "\">目录</a>]\n";
    if ($pkzip->create($_SESSION['flist'], PCLZIP_OPT_REMOVE_PATH, dirname($gopath))) {
        echo "文件&nbsp;" . ___basename($gopath) . "&nbsp;创建成功!";
    } else {
        echo "文件&nbsp;" . ___basename($gopath) . "&nbsp;无法建立!";
    }
}
xhtml_footer();
Beispiel #5
0
<?php

require "config.php";
if (!isset($_GET['path'])) {
    header("Location: ./404.php");
    exit;
} elseif (!file_exists($path = trim($_GET['path']))) {
    header("Location: ./404.php");
    exit;
}
xhtml_head("创建复件");
echo "[<a href=\"./dlym.php?path=" . urlencode(dirname($path)) . "\">返回目录</a>]\n";
if (isset($_GET['yes'])) {
    $to = dirname($path) . "/" . ___basename($path) . "-copy";
    if (file_exists($to)) {
        echo "目标复件已经存在!";
    } else {
        $fs = new filesystem($path);
        if ($fs->cppath($to)) {
            echo "成功为您创建复件!";
        } else {
            echo "无法为您创建复件!";
        }
    }
} else {
    echo "需要复件,<a href=\"?yes&path=" . urlencode($path) . "\">确认创建</a>?";
}
xhtml_footer();
Beispiel #6
0
                         }
                     }
                 }
                 echo "</optgroup>\n";
             } else {
                 if ($encode == "UTF-8") {
                     echo "<option value=\"{$encode}\" selected>{$encode}</option>\n";
                 } else {
                     echo "<option value=\"{$encode}\">{$encode}</option>\n";
                 }
             }
         }
     }
     echo "</select>\n";
     echo "<br />\n";
     echo "存档路径:<input type=\"text\" name=\"save\" value=\"" . ___basename($path) . ".out\" />(RW)\n";
     echo "<br />\n";
     echo "<input type=\"submit\" value=\"转换编码并存档到指定文件路径\" />(覆盖式写入)\n";
     echo "<br />\n";
     echo "</form>\n";
     echo "</div>\n";
 }
 echo "<div class=\"like\">\n爱特文件效验工具\n</div>\n";
 echo "<div class=\"love\">\n";
 echo "md5:";
 if (isset($_GET['md5'])) {
     echo "<br />" . md5_file($path);
 } else {
     echo "<a href=\"./file.php?{$_SERVER['QUERY_STRING']}&md5\">文件的&nbsp;MD5&nbsp;散列值</a>(效验文件)\n";
 }
 echo "</div>\n";
Beispiel #7
0
if (!isset($_GET['getcwd'])) {
    $getcwd = OPEN;
} else {
    $getcwd = ___realpath(trim($_GET['getcwd']));
}
xhtml_head("批量复制");
if (!is_dir($gopath = trim($_GET['gopath']))) {
    echo "<div class=\"error\">\n";
    echo "[<a href=\"./multiple.php?type=copy&getcwd=" . urlencode($getcwd) . "\">返回</a>]抱歉,目标目录非法!\n";
    echo "</div>\n";
} elseif (count($_SESSION['flist']) < 1) {
    echo "<div class=\"error\">\n";
    echo "[<a href=\"./dlym.php?path=" . urlencode($getcwd) . "\">返回</a>]抱歉,文件清单为空!\n";
    echo "</div>\n";
} else {
    $i = 0;
    $fs = new filesystem();
    echo "<div class=\"like\">\n";
    echo "<a href=\"./dlym.php?path=" . urlencode($getcwd) . "\">文件列表</a>(操作结果)\n";
    echo "</div>";
    while ($i < count($_SESSION['flist'])) {
        $fs->chpath($_SESSION['flist'][$i]);
        if ($fs->cppath($tmp = $gopath . "/" . ___basename($_SESSION['flist'][$i]))) {
            echo "<div class=\"love\">[{$i}][√]&nbsp;-&nbsp;{$tmp}</div>\n";
        } else {
            echo "<div class=\"error\">[{$i}][×]&nbsp;-&nbsp;{$tmp}</div>\n";
        }
        $i++;
    }
}
xhtml_footer();
Beispiel #8
0
require "config.php";
if (!isset($_GET['path'])) {
    header("Location: ./404.php");
    exit;
} elseif (!file_exists($path = trim($_GET['path']))) {
    header("Location: ./404.php");
    exit;
}
if (isset($_GET['name'])) {
    if (($name = trim($_GET['name'])) != "") {
        if (strpos($name, "/") === false || strpos($name, "\\")) {
            $to = dirname($path) . "/{$name}";
        } else {
            $to = $name;
        }
        if (rename($path, $to)) {
            header("Location: ?path=" . urlencode($to));
            exit;
        }
    }
}
xhtml_head("重新命名");
echo "<div class=\"like\">\n<a href=\"./dlym.php?path=" . urlencode(dirname($path)) . "\"]>返回目录</a>\n新的命名</div>\n";
echo "<div class=\"love\">\n";
echo "<form action=\"\" method=\"GET\">\n";
echo "<input type=\"hidden\" name=\"path\" value=\"{$path}\" />\n";
echo "<input type=\"text\" name=\"name\" value=\"" . ___basename($path) . "\" />\n";
echo "<input type=\"submit\" value=\"命名\" />\n";
echo "</form>\n";
echo "</div>\n";
xhtml_footer();
Beispiel #9
0
}
if (!isset($_GET['getcwd'])) {
    $getcwd = OPEN;
} else {
    $getcwd = ___realpath(trim($_GET['getcwd']));
}
xhtml_head("批量移动");
if (!is_dir($gopath = trim($_GET['gopath']))) {
    echo "<div class=\"error\">\n";
    echo "[<a href=\"./multiple.php?type=move&getcwd=" . urlencode($getcwd) . "\">返回</a>]抱歉,目标目录非法!\n";
    echo "</div>\n";
} elseif (count($_SESSION['flist']) < 1) {
    echo "<div class=\"error\">\n";
    echo "[<a href=\"./index.php?path=" . urlencode($getcwd) . "\">返回</a>]抱歉,文件清单为空!\n";
    echo "</div>\n";
} else {
    $i = 0;
    echo "<div class=\"like\">\n";
    echo "<a href=\"./index.php?path=" . urlencode($getcwd) . "\">文件列表</a>(操作结果)\n";
    echo "</div>";
    while ($i < count($_SESSION['flist'])) {
        if (rename($_SESSION['flist'][$i], $tmp = $gopath . "/" . ___basename($_SESSION['flist'][$i]))) {
            echo "<div class=\"love\">[{$i}][√]&nbsp;-&nbsp;{$tmp}</div>\n";
        } else {
            echo "<div class=\"error\">[{$i}][×]&nbsp;-&nbsp;{$tmp}</div>\n";
        }
        $i++;
    }
    unset($_SESSION['flist']);
}
xhtml_footer();