Beispiel #1
0
    } else {
        $type = '';
    }
}
if (strcasecmp($type, 'msg') == 0) {
    $max_file_count = 1;
} else {
    $max_file_count = BBS_MAXATTACHMENTCOUNT;
}
@($action = $_GET["act"]);
$msg = "";
if ($action == "delete") {
    @($act_attachname = $_GET["attachname"]);
    settype($act_attachname, "string");
    $filename = base64_decode($act_attachname);
    $ret = bbs_upload_del_file($filename);
    if ($ret) {
        $msg = bbs_error_get_desc($ret);
    } else {
        $msg = "删除 " . $filename . " 成功";
    }
} else {
    if ($action == "add") {
        $counter = @intval($_POST["counter"]);
        for ($i = 0; $i < $counter; $i++) {
            if (!isset($_FILES['attachfile' . $i])) {
                continue;
            }
            $attpost = $_FILES['attachfile' . $i];
            @($errno = $attpost['error']);
            switch ($errno) {
Beispiel #2
0
 /**
  *
  * @param string $name
  * @static
  * @access public
  * @throws AttException
  */
 public static function delAttach($name)
 {
     $ret = bbs_upload_del_file($name);
     if ($ret != 0) {
         throw new AttException(ECode::kbs2code($ret));
     }
 }