Check if file uploaded successfully
<p>To start off, I've set my <code>post_max_size</code> in <code>/etc/php.ini</code> to 4M just as a test. I have a check in place to check for file type and size of file. I want to only accept JPG, GIF and PNG. The file size cannot be larger than 4M. It seems that if the file size is larger than what's set in <code>post_max_size</code>, my code won't throw an error. If I set my PHP to deny uploads larger than let's say 2M but less than 4M, it'll throw an error (what i want). I believe this is due to PHP not accepting anything over 4M.</p>

<pre><code>if (is_uploaded_file($_FILES["file"]["tmp_name"])) 
{
    $file_type = exif_imagetype($_FILES["file"]["tmp_name"]);
} else {
    $this-&gt;form_validation-&gt;set_message('valid_image', 'Error uploading file!!!');
    return false;
}
</code></pre>
