title: cakephp download link behind the image or media files not working
body: <p>i am working on a cakephp 2.x ... i have a form in which i am taking the file from the user and then i am saving fileinto the <strong>app/uploads/userid</strong> folder and saving the path into db ... i am successfully fetch the file and showing it to the user but now the problem is during  downloading.. i mean whenever user click the file link it will redirected the user to some unknown link </p>
  
  <p>here is my code </p>
  
  <p>public function uploadFile(){</p>
  
  <pre><code>    if ($this-&gt;request-&gt;isPost()){
          $this-&gt;loadModel('Audio');
          $file = $this-&gt;request-&gt;data['Audio']['file'];
  
      $idUser = $this-&gt;Auth-&gt;user('idUser');
  
  
          if ($file['error'] === UPLOAD_ERR_OK) {
              $id = String::uuid();
              $name =$file['name'];
  
              $folder_url = APP.'uploads/'.$idUser;
          if(!is_dir($folder_url)) {
              mkdir($folder_url);
          }
          move_uploaded_file($file['tmp_name'],  $folder_url.DS.$name);
  
              $this-&gt;request-&gt;data['Audio']['User_id'] = $idUser;
              $this-&gt;request-&gt;data['Audio']['filename'] = $file['name'];
              $this-&gt;request-&gt;data['Audio']['filesize'] = $file['size'];
              $this-&gt;request-&gt;data['Audio']['filemime'] = $file['type'];
              $this-&gt;Audio-&gt;save($this-&gt;request-&gt;data);
  
  
              return true;
          }
      }
      return false;
  }
  
  
  
  public function showfile(){
   $this-&gt;loadModel('Audio');
      $record = $this-&gt;Audio-&gt;find('first', array('conditions' =&gt; array('User_id' =&gt;        $this-&gt;Auth-&gt;user('idUser'))));
      $this-&gt;set('file', $record);
  
  
  }
  </code></pre>
  
  <p>on my <strong>view page</strong></p>
  
  <pre><code>  &lt;?php  echo $this-&gt;Html-&gt;link($file['Audio']['filename'], APP . DS . 'uploads' . DS . $file['Audio']['User_id'] . DS . $file['Audio']['filename'] . DS . $file['Audio']['filemime']);?&gt;
  </code></pre>
  
  <p>here is the url after clicking the link</p>
  
  <pre><code>     /localhost/cakephp/media/C:/xampp/htdocs/cakephp/app//uploads/23/1011029_10152615392142588_1926259269_n.jpg/image/jpeg
  </code></pre>
  
  <p>i have tried every thing to make it work both nothing works out for me .. please i need help ..</p>