在php.ini中需要设置upload_max_filesize和post_max_size足够大才行,其他都是一样的。
另外重要的两点是:
enctype="multipart/form-data"
method="POST"
The "get" method restricts form data
set values to ASCII characters. Only
the "post" method (with
enctype="multipart/form-data") is
specified to cover the entire
[ISO10646] character set.
参考资料
更新
当上传文件大小超过php.ini规定尺寸时,$_FILES['file']['size']会变成0,
http://cn2.php.net/manual/en/features.file-upload.post-method.php
You can, for example, use the
$_FILES['userfile']['size'] variable
to throw away any files that are
either too small or too big. You could
use the $_FILES['userfile']['type']
variable to throw away any files that
didn't match a certain type criteria,
but use this only as first of a series
of checks, because this value is
completely under the control of the
client and not checked on the PHP
side.