【发布时间】:2017-08-20 13:31:31
【问题描述】:
我想在上传图像文件中添加限制。我想验证大小为 500kb。这是我的代码。
if(empty($_FILES["uthu"]["name"])) $errors[] = "拇指为空"; if($_FILES["uthu"]["error"] != 0) $errors[] = "上传缩略图出错"; $ext = strtolower(substr($_FILES["uthu"]["name"], -4)); if($ext != ".jpg") $errors[] = "为 Thumb 上传 .jpg"; $fnm1 = time().rand(1111,9999)."_".$_FILES["uthu"]["name"]; move_uploaded_file($_FILES["uthu"]["tmp_name"], "uploads/".$fnm1);【问题讨论】:
标签: javascript php html mysql php-5.6