function uppic($fileinfo)
{
    $p_type = array("jpg", "jpeg", "bmp", "gif");
    $default_path = 'pics/null.jpg';
    $picture_path = '../pics/';
    $reback = false;
    if ($fileinfo['size'] > 0 and $fileinfo['size'] < 700000) {
        if (($postf = f_postfix($p_type, $fileinfo['name'])) != false) {
            $picture_path .= time() . "." . $postf;
            if ($fileinfo['tmp_name']) {
                move_uploaded_file($fileinfo['tmp_name'], $picture_path);
                $reback = $picture_path;
            }
        }
    } else {
        $reback = $default_path;
    }
    return $reback;
}
Example #2
0
             } else {
                 echo "<script>alert('上传文件错误!');history.go(-1);</script>";
                 exit;
             }
         } else {
             echo "<script>alert('上传文件格式错误!');history.back(-1);</script>";
             exit;
         }
     } else {
         echo "<script>alert('上传文件大小错误!');history.go(-1);</script>";
         exit;
     }
 } else {
     if ($_POST[action] == "v") {
         if ($_FILES[address][size] < 10000000) {
             if (($postf = f_postfix($f_type, $_FILES[address][name])) != false) {
                 $file_path = time() . "." . $postf;
                 if ($_FILES[address][tmp_name]) {
                     move_uploaded_file($_FILES[address][tmp_name], $video_path . "\\" . $file_path);
                 } else {
                     echo "<script>alert('上传文件错误!');history.go(-1);</script>";
                     exit;
                 }
             } else {
                 echo "<script>alert('上传文件格式错误!');history.back(-1);</script>";
                 exit;
             }
         } else {
             echo "<script>alert('上传文件大小错误!');history.go(-1);</script>";
             exit;
         }
Example #3
0
        exit;
    }
} else {
    if ($_FILES['tb_video_picture']['size'] > 700000) {
        echo "<script>alert('上传图片大小超出范围!');history.go(-1);</script>";
        exit;
    } else {
        $picture = "";
    }
}
/******************************/
/*  判断上传文件类型与大小,上传文件  */
if ($_FILES['tb_video_address']['size'] > 0) {
    //如果是音频文件
    if ($_FILES['tb_video_address']['size'] < 70000000) {
        if (($postf = f_postfix($f_type, $_FILES['tb_video_address']['name'])) != false) {
            $file_path = time() . "." . $postf;
            $tb_video_address = $video_path . "/" . $file_path;
            if ($_FILES['tb_video_address']['tmp_name']) {
                move_uploaded_file($_FILES['tb_video_address']['tmp_name'], $video_path . "\\" . $file_path);
            } else {
                echo "<script>alert('上传文件错误!');history.go(-1);</script>";
                exit;
            }
        } else {
            echo "<script>alert('上传文件格式错误!');history.back(-1);</script>";
            exit;
        }
    } else {
        echo "<script>alert('上传文件大小错误!');history.go(-1);</script>";
        exit;