PS:上传的时候一定要用POST方法,GET方法不行。
文件上传的entype要改成“mutilpart/form-data”这个编码
<html>
<form action="upload.php" method="POST" enctype="mutilpart/form-data">
<input type="hidden" name="MAX_FILE_SIZE">
uplaod file:<input type="file" name="pic" value="">
<input type="submit" value="uplaod" name="pic">
</form>
</html>
<input type="hidden" name="MAX_FILE_SIZE">是一个隐藏的表单。MAX_FILE_SIZE是做的允许上传的值,默认的MAX_FILE_SIZE是2M.

但是这个也是可以更改的,在PHP.ini当中进行修改,但是修改的同时,所有的POST都会被修改成那个数据,比如你的一个POST登陆的表单。
原文:http://www.cnblogs.com/xishaonian/p/6411621.html