这是一个创建于 4992 天前的主题,其中的信息可能已经有所发展或是发生改变。
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
if (!is_uploaded_file($_FILES["upfile"]["tmp_name"]))
//是否存在文件
{
echo "<font color='red'>文件不存在!</font>";
exit;
}
$file = $_FILES["upfile"];
if($max_file_size < $file["size"])
//检查文件大小
{
echo "<font color='red'>文件太大!</font>";
exit;
}
if(!in_array($file["type"], $uptypes))
//检查文件类型
{
echo "<font color='red'>只能上传图像文件或Flash!</font>";
exit;
}
2 条回复 • 1970-01-01 08:00:00 +08:00
|
|
1
Sai 2011-01-20 11:44:45 +08:00
getimagesize()
|
|
|
2
bobhero 2011-01-21 10:16:34 +08:00
不知道这个算不算一句 call_user_func( function($size){ list($width,$height) = $size; return $width>500 and $height>500; }, getimagesize('a.png')));
|