title: CakePHP Clicking PDF Link and View it on New Tab
body: <p>Ok, so I have a web app that uploads a file to the webserver. My input fields in my upload form include: type of upload (dropdown list), title, description, and the file to be uploaded, which is a PDF.</p>
  
  <p>Once the PDF file is uploaded, the download link will appear in another page for the public to see. In addition, the title typed in the input field is the download link.</p>
  
  <p>Now, I want to change my code. Instead of downloading it directly when the link is clicked I want it to open in a new tab, so the users can first look at the PDF file then download it from there.</p>
  
  <p>Here are my codes.</p>
  
  <p>Controller:</p>
  
  <pre><code>public function sendFile(){
          $id = $this-&gt;request-&gt;params['pass'][0];
          $staffup = $this-&gt;StaffUpload-&gt;find('first', array('conditions' =&gt; array('iduploads'=&gt;$id)));
          $this-&gt;response-&gt;file($staffup['StaffUpload']['dest'], array('download' =&gt; true, 'name' =&gt; $staffup['StaffUpload']['title']));
          return $this-&gt;response;
      }
  </code></pre>
  
  <p>The code above is the download function.</p>
  
  <pre><code>public function resources() {
          $this-&gt;layout = 'website';
          $this-&gt;set('staff_uploads', $this-&gt;StaffUpload-&gt;find('all', array('conditions' =&gt; array('type' =&gt; 'Resource'))));
      }
  </code></pre>
  
  <p>The code above is the view wherein I show all uploaded files which type is Resources.</p>
  
  <p>View:</p>
  
  <pre><code>    &lt;?php
           foreach ($staff_uploads as $staff_uploads) {
      ?&gt;
      ul&gt;
           &lt;li&gt;
           &lt;?php
                echo $this-&gt;Html-&gt;link($staff_uploads['StaffUpload']['title'],   array('controller' =&gt; 'websites', 'action' =&gt; 'sendFile',  $staff_uploads['StaffUpload']['iduploads']));
           ?&gt;
           &lt;/li&gt;
      &lt;/ul&gt;
  &lt;?php
       }
  ?&gt;
  </code></pre>
  
  <p>The code above shows the view.</p>
  
  <p>So yeah, back to the question. I want to change the download link to a link in which when clicked, will show the PDF file in a new tab. How do I do that? And by the way, the codes posted above are all working properly. I just want to change my code so that it will be viewed in a new tab when clicked. </p>
  
  <p>Thank you!</p>