当我用简单的表格上传文件时
Warning: POST Content-Length of 372220927 bytes exceeds the limit of 33554432 bytes in Unknown on line 0
Notice: Undefined index: file in C:\xampp\htdocs\php_upload\upload_file.php on line 3我在php_ini中更改为20M,我的问题是我想要回复关于太大文件的很好的msg错误,没有这样的警告。我可以尝试/抓住一个错误/错误。在打电话之前,我可以发现“警告”:
$_FILES"file">0
<form action="upload_file.php" method="post"
<form action="upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label></br>
<input type="file" name="file" id="file"></br>
<input type="text" name="desc" id="desc"></br>
<input type="submit" name="submit" value="Submit">
</form>//
if ($_FILES["file"]["error"]>0)
{
echo "Error: " . $_FILES["file"]["error"] . "<br>";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br>";
echo "Type: " . $_FILES["file"]["type"] . "<br>";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>";
echo "Stored in: " . $_FILES["file"]["tmp_name"];
}https://stackoverflow.com/questions/13943918
复制相似问题