title: How do I get the PHP Uploads directory?
body: <p>I have uploaded a file using HTML / PHP and following is the print_r() of the $_FILES['file'] array:</p>
  
  <pre><code>Array
  (
      [name] =&gt; Chrysanthemum.jpg
      [type] =&gt; application/octet-stream
      [tmp_name] =&gt; G:\xampp\tmp\php82DB.tmp
      [error] =&gt; 0
      [size] =&gt; 879394
  )
  </code></pre>
  
  <p>As you can see above, the temp file is stored in the tmp_name directory. I need to get that directory path using PHP. How do I get it ?</p>
  
  <p>Tried using <code>sys_get_temp_dir()</code> but this is what it returns me.</p>
  
  <p>I do NOT want to get the directory from the array or from the file upload data. I want to dynamically get the php file uploads directory using a function.</p>
  
  <pre><code>C:\Users\admin\AppData\Local\Temp
  </code></pre>