print_r($FILES['ic_file']);帖出结果

解决方案 »

  1.   

    贴出$FILES吧,看看error中是啥信息,目前还看不出来哪里出问题了
      

  2.   

    Array
    (
        [name] => helv6.jpg
        [type] => 
        [tmp_name] => 
        [error] => 3
        [size] => 0
    )或者这里测试:http://tuan.66ka.com/up3.php
      

  3.   

    先谢谢朋友关注先;我用的是tomcat服务器;服务器标识是Linux ZJHT-WEB03.chinaexpresscard.com 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:43 EDT 2010 i686 ;
    服务器操作系统 Linux  内核版本: 2.6.18-194.el5 服务器解译引擎 Apache/2.2.3 (Red Hat) 目录是有写的权限的,该给的全给了,而且小于10k的是正常上传的
      

  4.   

    print_r($_POST);  加上它时,如果选择的图片大于10k,就只打印一个:Array ( [MAX_FILE_SIZE] => 10485761 ) ;
      

  5.   

    上传了个大文件,发现有错误。
    Array ( [name] => gy.jpg [type] => [tmp_name] => [error] => 3 [size] => 0 ) 
    error=>3,这个是重点。顺着google之,3表示UPLOAD_ERR_PARTIALUPLOAD_ERR_PARTIAL    Value: 3; The uploaded file was only partially uploaded.
    意思是只有部分上传,然后查看php bug,发现
    https://bugs.php.net/bug.php?id=19556
    这里面有个家伙说他解决了类似的问题
    I have solved this problem, it appears to be caused by the installation of Gzip 1.3.26.1aI recompiled Apache without Gzip and when I now retry the error does not occur anymore. In effect the script is not executed at all which is probably the default behaviour.
    是因为apache开启了gzip压缩页面的功能,你自己研查下。
      

  6.   

    <input type="hidden" name="MAX_FILE_SIZE" value="10485761" />
    限制了大小,查看源码
      

  7.   

    刚刚也把服务器的gzip关闭 重启 apache 结果还是一样
      

  8.   

    你的这个空间网络咋样啊,baidu的时候看不少人都说网络影响
      

  9.   

    ; Maximum allowed size for uploaded files.
    upload_max_filesize = 20M
    ; Maximum number of files that can be uploaded via a single request
    max_file_uploads = 20
      

  10.   

    是不是.htaccess或者apache配置文件又有设置,导致覆盖了php.ini的配置值
      

  11.   

    php.ini或者.htaccess 配置问题。妥妥的。查找 post_max_size .改为
    post_max_size = 200M查找upload_max_filesize,默认为8M改为
    upload_max_filesize = 200M
      

  12.   

    你不能看php.ini的话,直接phpinfo()查找
    upload_max_filesize
    post_max_size
      

  13.   

    处理上传页面的PHP程序加上set_time_limit(0);试一下
      

  14.   

    谢谢各位给力探讨以上所提出的方法我都试了,除了18楼的,我现在的设置是30M和20M,是足够大的了刚刚我对 $_POST 进行数组打印分析:
    当正常上传时会出现Array ( [MAX_FILE_SIZE] => 1024000000 [u] => 上传图片 );
    当失败时只有Array ( [MAX_FILE_SIZE] => 1024000000) ,没有[u] => 上传图片;对 $_FILES['ic_file'] 进行数组打印分析:
    当正常上传时会出现Array ( [name] => helv1.jpg [type] => image/pjpeg [tmp_name] => /opt/tomcat/webapps/66ka/tmpimg/phpoc1ASw [error] => 0 [size] => 14352 );
    当失败时就会出现:Array ( [name] => helv3.jpg [type] => [tmp_name] => [error] => 3 [size] => 0 ),除了[name],其它的值是空的;目前原因不明!
      

  15.   

    错误号为3表示只有部分上传,你不妨用#9的方法去尝试。I recompiled Apache without Gzip and when I now retry the error does not occur anymore. In effect the script is not executed at all which is probably the default behaviour.这段英文好好理解一下。他好像是说丢掉Gzip重新编译一下apache。自己琢磨琢磨。也不太懂。
      

  16.   

    我也遇到了这个问题,后来发现貌似和帐户以及对应权限有关,我因为之前装过iis,后来又转用apache,帐户有了一些混乱,后来发现guest用户被禁用,打开后就好了。不知道对楼主有没有帮助。
      

  17.   

    偶然看到了这篇文章,不知道是否有用:
    I have just spent the last 3 hours trying to figure out why only ever 3rd file would upload (and then files would only randomly upload) and i continued to get UPLOAD_ERR_PARTIAL. It turns out UPLOAD_ERR_PARTIAL can be caused by the header Connection: Keep-Alive.If you are working on a web app that requires a lot of file uploading, make sure to use on your uploader script to set:
    header("Connection: close");This will force the connection to be closed, and for a new connection to be opened to upload the file, which allows the file to be properly uploaded.
    http://www.bizzeh.com/739/php-problem-with-upload_err_partial-file-upload-error-code-3