title: php Maximum size upload not validating properly
body: <pre><code>if(!empty($employeepic)) {
      if ((($employeepic_type == 'image/jpg') ||($employeepic_type == 'image/jpeg') ||($employeepic_type == 'image/gif') ||
           ($employeepic_type == 'image/png')) &amp;&amp; ($employeepic_size &lt;= EMP_MAXSIZE) &amp;&amp; ($employeepic_size &gt; 0)){
          // Move the file to the target upload folder
          $target = (EMP_UPLOADPATH .$firstname.$employeepic);
          if(move_uploaded_file($_FILES['employeepic']['tmp_name'],$target)){
              $employee = $firstname. " " .$lastname;
          }
      }else{
          $filetoobig =' &lt;p class="error"&gt; There was a problem uploading your picture. Maximum size is 30K and must be in jpg, jpeg or pjpeg format&lt;/p&gt;';
          @unlink($_FILES['employeepic']['tmp_name']);
      }
  }
  </code></pre>
  
  <p>Can anyone see why the validation of file size not working?</p>
  
  <pre><code>(EMP_MAXSIZE = 32768)
  </code></pre>
  
  <p><strong>Edit:</strong> The limit size is set at 32768 but can still upload 2MB files </p>
  
  <p><strong>Edit:</strong> The code to assign <code>Employee_pic</code> Size:</p>
  
  <pre><code>$employeepic = mysqli_real_escape_string($dbc, trim($_FILES['employeepic']['name']));
  $employeepic_type = $_FILES['employeepic']['type'];
  $employeepic_size = $_FILES['employeepic']['size'];
  </code></pre>