Ignore:
Timestamp:
03/22/11 18:19:49 (13 years ago)
Author:
alexandrecorreia
Message:

Ticket #1660 - Enviar arquivos pelo filemanager, tratado o erro para o php.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/filemanager/inc/upload.php

    r3881 r3889  
    22 
    33require_once '../../header.session.inc.php'; 
     4 
     5$post_limit = error_get_last( ); 
     6 
     7if ( preg_match( '/POST Content-Length of (\d+) bytes exceeds the limit of \d+ bytes/i', $post_limit[ 'message' ], $matches ) ) 
     8{ 
     9        $_SESSION['response'] =  serialize( array( 
     10                 'postsize' => $matches[ 1 ], 
     11                 'max_postsize' => ini_get( 'post_max_size' ) 
     12        ) ); 
     13        exit; 
     14} 
    415 
    516/* This single file is used to increase upload_max_filesize and post_max_size using .htaccess*/ 
     
    8697if( $path != '/' ) 
    8798{ 
     99        $return = array( ); 
    88100        for( $i = 0; $i != $show_upload_boxes; $i++) 
    89101        { 
    90                 if ( $_FILES['upload_file']['size'][$i] > ($upload_max_size*1024*1024) ) 
     102                if ( $_FILES['upload_file']['error'][$i] !== 0 ) 
     103                { 
     104                        $return[] = array(  
     105                                        "file"          => $_FILES['upload_file']['name'][$i] , 
     106                                        "filesize"      => 'filesize #' . $_FILES['upload_file']['error'][$i] 
     107                         ); 
     108                        continue; 
     109                } 
     110                elseif ( $_FILES['upload_file']['size'][$i] > ($upload_max_size*1024*1024) ) 
    91111                { 
    92112                        $return[] = array(  
     
    219239        } 
    220240         
    221         error_log(print_r($return, true), 3, "/tmp/log"); 
     241        //error_log(print_r($return, true), 3, "/tmp/log"); 
    222242} 
    223243 
Note: See TracChangeset for help on using the changeset viewer.