我有一個像這樣的上傳表單。在php中上傳表格max_size
<body>
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="file" value="file"/>
<input type="submit" value="UPLAOD" name="upload"/><br/>
</body>
和upload.php的爲:
if($_FILES["file"]["error"]>0)
echo "ERROR: ".$_FILES["file"]["error"]."<br/>";
else{
if(file_exists("./".$_FILES["file"]["name"]))
echo "File already exists.";
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],"./".$_FILES["file"]["name"]);
echo "File Uploaded.";
}
}
我php.ini
改變upload_max_filesize=10M , post_max_size=8M
但我仍然無法上傳5MB大小的文件。什麼可能出錯?
當我運行phpinfo()
,它仍然顯示upload_max_size=2M
這是我改變它之前的值10M
。
有您重新啓動web服務? – PeeHaa
你在一個共享的主機,這會阻止你更新這些值? –
沒有共享主機....只是爲了學習的目的。我正在使用WAMP – user1870867