时间:2021-07-01 10:21:17 帮助过:16人阅读
if($_FILES["file"]["error"] > 0) { echo "Upload Error: ". $_FILES["file"]["error"] . ""; }else { echo "Upload : ". $_FILES["file"]["name"] . ""; echo "Type : ". $_FILES["file"]["type"] . ""; echo "Size : ". $_FILES["file"]["size"]/1024 . " kb"; echo "Store in : ". $_FILES["file"]["tmp_name"] . "" ; }?>
if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 20000)) { if ($_FILES["file"]["error"] > 0) { echo "Error: " . $_FILES["file"]["error"] . ""; }else { echo "Upload: " . $_FILES["file"]["name"] . ""; echo "Type: " . $_FILES["file"]["type"] . ""; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb"; echo "Stored in: " . $_FILES["file"]["tmp_name"]; } }else { echo "Invalid file"; }?>
if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 20000)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . ""; }else { echo "Upload: " . $_FILES["file"]["name"] . ""; echo "Type: " . $_FILES["file"]["type"] . ""; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . ""; if (file_exists("upload/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; }else { move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]); echo "Stored in: " . "upload/" . $_FILES["file"]["name"]; } } }else { echo "Invalid file"; }?>
< 上一篇
关于apache服务器rewrite
下一篇 >
centosLAMP搭建网站
记住我的登录 忘记密码?
登录
我已阅读用户协议及版权声明
注册