title: move_uploaded_file(): Unable to move '/tmp/php4l8IAc' to upload dir
body: <p>I'm getting error when I move the uploaded file. I checked upload path,it seems correct and also I checked directory permission too (755 - 777 both of them). </p>
  
  <p>But it still I'm getting this error, what is my mistake ?</p>
  
  <p>file uploader class</p>
  
  <pre><code>public function __construct($file,$mimes = ["jpg","png","jpeg"],$size = null)
      {
       $this-&gt;file = $file;
       $this-&gt;mimes = $mimes;
       $this-&gt;sSize = $size;
       $this-&gt;butcher();
      }
  private function butcher(){
  
      $this-&gt;realName = pathinfo($this-&gt;file-&gt;name,PATHINFO_FILENAME);
      $this-&gt;size = $this-&gt;file-&gt;size;
      $this-&gt;error = $this-&gt;file-&gt;error;
      $this-&gt;tmpName = $this-&gt;file-&gt;tmp_name;
  
      $this-&gt;checkErrors();
  } // and some control functions...
  
  private function createUniqueName()
  {
      $this-&gt;newName = $this-&gt;realName . "-" . time() . "." . $this-&gt;extension;
  }
  
  public function upload()
  {
  
      $destination = CONFIG["upload_dir"] . "/" . $this-&gt;newName;
      move_uploaded_file($this-&gt;tmpName, $destination);
  }
  </code></pre>
  
  <p>and controller </p>
  
  <pre><code>public function store(RequestInterface $request)
  {
      // unqiue name created in construct circle   
      $file = new FileUploader($request-&gt;getFile("image"));
      // then upload the file
      $file-&gt;upload();
  ...
  </code></pre>
  
  <p>and upload dir (in config file)</p>
  
  <pre><code>'upload_dir' =&gt; PUBLIC_PATH."/uploads"
  </code></pre>
  
  <p>and constants</p>
  
  <pre><code>define("PUBLIC_PATH",BASE_PATH."/public");
  define ('BASE_PATH', realpath(dirname(__FILE__)));
  </code></pre>
  
  <p>var_dump(CONFIG["upload_dir"]);</p>
  
  <pre><code>/var/www/cms/public/uploads
  </code></pre>
  
  <p>So.. any advice ?</p>