Upload file larger than 5MB
<p>I tried to create an application wich allows me to upload files larger then 5 MB but I always get an error that says that the file is to large.  I modified php.ini upload_max_filesize and post_max_size and set it to 1GB but it did not work.</p>

<p>This is my code:</p>

<pre><code>if(is_uploaded_file($_FILES['pdf']['tmp_name'])&amp;&amp;($_FILES['pdf']['error'] == UPLOAD_ERR_OK)){
    $file = $_FILES['pdf'];
    $size = round($file['size']/10485760);
    if($size &gt; 10485760){
        echo 'The uploaded file was to large.';
    }

    if(($file['type'] != 'application/pdf') &amp;&amp; (substr($file['name'], -4) !='.pdf')){
        echo 'The uploaded file was not a PDF.';
    }

    if(!array_key_exists('pdf', $add_pdf_errors)){
        $tmp_name = sha1($file['name'].uniqid('', TRUE));
        $dest = '../pdfs/'.$tmp_name.'_tmp';

        if(move_uploaded_file($file['tmp_name'], $dest)){
            $_SESSION['pdf']['tmp_name'] = $tmp_name;
            $_SESSION['pdf']['size'] = $size;
            $_SESSION['pdf']['file_name'] = $file['name'];
            echo '&lt;h4&gt;The file has been uploaded!&lt;/h4&gt;';
        }else{
            trigger_error('The file coul not be moved.');
            unlink($file['tmp_name']);
        }
    }
}else{
    switch ($_FILES['pdf']['error']){
        case 1:
        case 2:
            echo 'The uploaded file was to large.';
            break;
        case 3:
            echo 'The file was only partially uploaded.';
            break;
        case 6:
        case 7:
        case 8:
            echo 'The file could not be uploaded to a system error.';
            break;
        case 4:
        default:
            echo 'No file was uploaded.';
            break;
    }
}
</code></pre>

<p>How can I resolve this problem?</p>
