title: Uploading doc & docx file in php not working
body: <p>I have a code which is uploading two files(image &amp; text) in two different folders. </p>
  
  <pre><code>        $file_path = "users/".$uname."/dp/";
          $file_path2 = "users/".$uname."/resume/";
  
          $q=mkdir("users/".$uname."/dp/", 0777, $recursive=true);
          $r=mkdir("users/".$uname."/resume/", 0777, $recursive=true);
          if($q &amp;&amp; $r)
          {
               $targate = $file_path.basename($_FILES['dp']['name']);
              //echo $targate ;die;
              if ((($_FILES['dp']["type"] == "image/gif") || ($_FILES['dp']["type"] == "image/jpeg") || ($_FILES['dp']["type"] == "image/png") || 
                  ($_FILES['dp']["type"] == "image/jpg")) &amp;&amp; ($_FILES['dp']["size"] &lt; 20000))
              {
                  if ($_FILES['dp']["error"] &gt; 0)
                  {
                      echo "Return Code: " . $_FILES['dp']["error"] . " ";
                  }
                  else
                  {
                      move_uploaded_file($_FILES['dp']["tmp_name"], $targate);
                  }
              }
              else
              {
                  //echo "Invalid file";
              }
  
               $targate2 = $file_path2.basename($_FILES['resume']['name']);
              //echo $targate2 ;die;
              if ((($_FILES["resume"]["type"] == "text/plain")   || ($_FILES["resume"]["type"] == "application/msword")
              || ($_FILES["resume"]["type"] == "application/vnd.openxmlformats-officedocument.wordprocessingml.document")) &amp;&amp; $_FILES['resume']["size"] &lt; 20000)
              {
                  if ($_FILES['resume']["error"] &gt; 0)
                  {
                      echo "Return Code: " . $_FILES['resume']["error"] . " ";
                  }
                  else
                  {
                      move_uploaded_file($_FILES['resume']["tmp_name"], $targate2);
  
                  }
              }
              else
              {
                  //echo "Invalid file";
              }
  
              echo "success";die;
          }
          else{ echo "fail";die;}
  </code></pre>
  
  <p>For all types of images its working fine. But in case of text files <strong>(doc &amp; docx files)</strong> it prints <strong>success</strong> but only image file is being uploaded.</p>
  
  <p>When I replace this </p>
  
  <pre><code>if ((($_FILES["resume"]["type"] == "text/plain")
              || ($_FILES["resume"]["type"] == "application/msword")
              || ($_FILES["resume"]["type"] == "application/vnd.openxmlformats-officedocument.wordprocessingml.document")) &amp;&amp; $_FILES['resume']["size"] &lt; 20000)
  </code></pre>
  
  <p>condition  with</p>
  
  <pre><code>if (($_FILES["resume"]["type"] == "text/plain")
               &amp;&amp; $_FILES['resume']["size"] &lt; 20000)
  </code></pre>
  
  <p>this works fine for <strong>.txt</strong>
  What is the problem? Where I am doing it wrong?</p>