最近两天被一个非常奇怪的问题困扰着——我写的php页面接收不到表单传过来的文件。上网找了n多资料,什么权限啊php或apache的配置啊什么的,发现我的权限和配置是正确的,但为什么还是无法上传呢?找到问题时我真是哭笑不得,原因是我的form丢了一个属性:
原本: <form method="post" action="test.php" onsubmit="return check()" >
改成: <form method="post" action="test.php" onsubmit="return check()" enctype="multipart/form-data">
就ok了。。。