当前位置:Gxlcms > PHP教程 > php文件上传,该如何处理

php文件上传,该如何处理

时间:2021-07-01 10:21:17 帮助过:16人阅读

php文件上传
Notice: Undefined index: file in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\updoad-file.php on line 3 Notice: Undefined index: file in C:\Program Files\Apache Softw are Foundation\Apache2.2\htdocs\updoad-file.php on line 9 Upload:
Notice: Undefined index: file in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\updoad-file.php on line 10 Type:
Notice: Undefined index: file in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\updoad-file.php on line 11 Size: 0 Kb
Notice: Undefined index: file in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\updoad-file.php on line 12 Stored in:
怎么一直提示这个,不懂,求教!!!!

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"];
}
?>


------解决方案--------------------
表单文件控件的name不是file吧?

------解决方案--------------------
检查一下php.ini,看看是否允许上传文件(file_uploads = On)。
------解决方案--------------------
除了name以外其他几个都没有值,应该是上传未完成php就执行了
传送的文件太大了?
------解决方案--------------------
表单:



php.ini里也要设置下. file_uploads = On。

人气教程排行