|
查看: 1365|回复: 3
|
PHP File upload问题
[复制链接]
|
|
|
发表于 26-11-2008 01:17 PM
|
显示全部楼层
非常谢谢..
我找到解决方法了...
-
- UPLOAD_ERR_OK
- Value: 0; There is no error, the file uploaded with success.
- UPLOAD_ERR_INI_SIZE
- Value: 1; The uploaded file exceeds the upload_max_filesize directive in php.ini.
- UPLOAD_ERR_FORM_SIZE
- Value: 2; The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.
- UPLOAD_ERR_PARTIAL
- Value: 3; The uploaded file was only partially uploaded.
- UPLOAD_ERR_NO_FILE
- Value: 4; No file was uploaded.
- UPLOAD_ERR_NO_TMP_DIR
- Value: 6; Missing a temporary folder. Introduced in PHP 4.3.10 and PHP 5.0.3.
- UPLOAD_ERR_CANT_WRITE
- Value: 7; Failed to write file to disk. Introduced in PHP 5.1.0.
- UPLOAD_ERR_EXTENSION
- Value: 8; File upload stopped by extension. Introduced in PHP 5.2.0.
-
复制代码 |
|
|
|
|
|
|
|
|
|
|
$uploadedError = $_FILES['uploadedfile']['error'];
我想问...
当我要upload的时候...
我要上载 picture..
然后发现有问题...
我echo出来的时候
Array
ABC.JPG << file name
image/pjpeg << file type
246464 << file size
C:\wamp\tmp\php1D5.tmp <<<<<<<<<< ['tmp_name'];
0 <<<<<<<<< $_FILES['uploadedfile']['error'];
500000 << limit file size
当有时我upload其它jpeg...
他的 $_FILES (error)
是 2
如果是空的话就是 $_FILES (error) = 4
没有问题的时候是 0
有没有人知道 2 和 4 是什么意思?? |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 26-11-2008 09:30 AM
|
显示全部楼层
原帖由 wcpon 于 25-11-2008 06:26 PM 发表 
$uploadedError = $_FILES['uploadedfile']['error'];
我想问...
当我要upload的时候...
我要上载 picture..
然后发现有问题...
我echo出来的时候
Array
ABC.JPG
怎么又没有人回答我的问题啊???
求助.....  |
|
|
|
|
|
|
|
|
|
|
发表于 26-11-2008 12:22 PM
|
显示全部楼层
这里有error 的list
http://my.php.net/features.file-upload.errors
2:
File 太大了。这个应该是在Apache / IIS 里面set 的。
4:
没有file。 |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|