title: when download button is clicked download should happen at backend
body: <p>i have a download botton..onclick of download button the download should happen at the backend and i should continue doing other tasks ..download should not break when i click on other button..is there a way in php to handle this.. if so what method can be used
  i have tried with curl function</p>
  
  <pre><code>&lt;?
  $ch = curl_init();
  
  curl_setopt($ch, CURLOPT_URL, 'http://localhost:8888/test/download_ipad.php');
  curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
  curl_setopt($ch, CURLOPT_TIMEOUT, 1);
  
  curl_exec($ch);
  curl_close($ch);
  ?&gt;
  </code></pre>
  
  <p>but instead of downloading it is printing whole of the file</p>