hello à tous ,

qui pourrait juste m'expliquer ce bout de code car si j'ai bien compris c'est ici que ma limite pour un upload s'effectue et j'aimerai changer la valeur

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 
if ( $_SERVER['REQUEST_METHOD'] === 'POST' )
{
    // Need to detect if post_max_size has been reached. If so, all post variables are gone...
    $postMaxSize = trim( ini_get( 'post_max_size' ) );
    $postMaxSizeBytes = $postMaxSize;
    $postMaxSizeUnit = 'b';
    // post_max_size can have values like 8M which needs to be converted to bytes
    $last = strtolower( $postMaxSize[strlen($postMaxSize)-1] );
    if ( !is_numeric( $last ) )
        $postMaxSize = substr( $postMaxSize, 0, -1 );
    switch ( $last )
    {
        case 'g':
            $postMaxSizeBytes *= 1073741824; // = 1024 * 1024 * 1024
            $postMaxSizeUnit = 'Gb';
            break;
        case 'm':
            $postMaxSizeBytes *= 1048576; // = 1024 * 1024
            $postMaxSizeUnit = 'Mb';
            break;
        case 'k':
            $postMaxSizeBytes *= 1024;
            $postMaxSizeUnit = 'Kb';
            break;
    }
    if ( (int)$_SERVER['CONTENT_LENGTH'] > $postMaxSizeBytes &&  // This is not 100% acurrate as $_SERVER['CONTENT_LENGTH'] doesn't only count post data but also other things
        count( $_POST ) === 0 )                                 // Therefore we also check if request got no post variables.
    {
        $validation['attributes'][] = array( 'id' => '1',
                                             'identified' => 'generalid',
                                             'name' => ezpI18n::tr( 'kernel/content', 'Error' ),
                                             'description' => ezpI18n::tr( 'kernel/content', 'The request sent to the server was too big to be accepted. This probably means that you uploaded a file which was too big. The maximum allowed request size is %max_size_string.', null, array( '%max_size_string' => "$postMaxSize $postMaxSizeUnit" ) ) );
        $validation['processed'] = true;
    }
}
merci par avance