php 文件上传$_FILES怎么为空?
htm:<formid="bwform"name="bwform"action="uploadfile.php"method="post"enctype="multipa...
htm:
<form id="bwform" name="bwform" action="uploadfile.php" method="post" enctype="multipart/form-data"><center>
<fieldset style=width:80%>
<legend>软件更新:</legend><br>
<span >
<input type="file" id="file" name="file"/>
</span>
<br><br>
</fieldset>
<span ><br><br>
<input type="image" name="Submit" id="input0" src="images/input/link/input0.png" onMouseUp="up('input',0,2)" onMouseDown="down('input',0,2)">
<img id="input1" src="images/input/link/input1.png" onMouseUp="up('input',1,2)" onMouseDown="down('input',1,2)" onClick="document.bwform.reset();">
</span></center>
</form>
php:
<?php
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"]. "<br />";
print_r($_FILES);
}
?>
输出:
Upload:
Type:
Size: 0 Kb
Stored in:
Array ( )
php.ini max_execution_time = 0,post_max_size = 150M,upload_max_filesize = 100M。file_uploads = On也都修改了。文件没有超过 展开
<form id="bwform" name="bwform" action="uploadfile.php" method="post" enctype="multipart/form-data"><center>
<fieldset style=width:80%>
<legend>软件更新:</legend><br>
<span >
<input type="file" id="file" name="file"/>
</span>
<br><br>
</fieldset>
<span ><br><br>
<input type="image" name="Submit" id="input0" src="images/input/link/input0.png" onMouseUp="up('input',0,2)" onMouseDown="down('input',0,2)">
<img id="input1" src="images/input/link/input1.png" onMouseUp="up('input',1,2)" onMouseDown="down('input',1,2)" onClick="document.bwform.reset();">
</span></center>
</form>
php:
<?php
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"]. "<br />";
print_r($_FILES);
}
?>
输出:
Upload:
Type:
Size: 0 Kb
Stored in:
Array ( )
php.ini max_execution_time = 0,post_max_size = 150M,upload_max_filesize = 100M。file_uploads = On也都修改了。文件没有超过 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询