我已经从下面的脚本中删除了所有不相关的代码,试图缩小这个问题的范围,但即使我现在只是“裸心”,它仍然无法工作。为什么我的文件上传表单没有工作?
Web服务器错误日志中没有关于此的错误,并且print_r($ _ Files)为空。有什么可能阻止这从工作请?
我试图上传的文件是20Kb。 php服务器变量upload_max_filesize = 100M和post_max_size = 101M。
<?
echo 'Here is some debugging info:';
print_r($_FILES);
if ($_FILES['image']['name']) {
echo "\n\nFiles Detected";
} else {
?>
<!DOCTYPE HTML>
<html>
<head>
<title>File Upload</title>
</head>
<body>
<form
action = "<?=$_SERVER['PHP_SELF']?>"
enctype = "multipart/form-data"
name = "uploadImage">
Upload:
<input type='file' name='image'><br><br>
<input type="submit" value="Upload">
</form>
</body>
</html>
<? } ?>
未检测到文件。
在你的工作场所有防火墙吗? – Cups
你添加了:method =“POST”到你的表单吗? –
啊,是的,丢失后的方法,也许吧,http://php.net/manual/en/features.file-upload.post-method.php我陷入了“工作中没有工作”的评论... – Cups