title: How to download client-site a video with cURL / PHP?
body: <p>If the following PHP is runnig, I would like to download the file with `cURL on the client-site. It means, if one of my website visitor run's an action, which starts this PHP file, it should download the file on this PC.</p>
  
  <p>I tried with different locations, but without any success. If I run my code, it does always download it on my WebSever, which is not this, what I want.</p>
  
  <pre><code>&lt;?php
  //The resource that we want to download.
  $fileUrl = 'https://www.example.com/this-is-a-example-video';
  
  //The path &amp; filename to save to.
  $saveTo = 'test.mp4';
  
  //Open file handler.
  $fp = fopen($saveTo, 'w+');
  
  //If $fp is FALSE, something went wrong.
  if($fp === false){
      throw new Exception('Could not open: ' . $saveTo);
  }
  
  //Create a cURL handle.
  $ch = curl_init($fileUrl);
  
  //Pass our file handle to cURL.
  curl_setopt($ch, CURLOPT_FILE, $fp);
  
  //Timeout if the file doesn't download after 20 seconds.
  curl_setopt($ch, CURLOPT_TIMEOUT, 20);
  
  //Execute the request.
  curl_exec($ch);
  
  //If there was an error, throw an Exception
  if(curl_errno($ch)){
      throw new Exception(curl_error($ch));
  }
  
  //Get the HTTP status code.
  $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  
  //Close the cURL handler.
  curl_close($ch);
  
  if($statusCode == 200){
      echo 'Downloaded!';
  } else{
      echo "Status Code: " . $statusCode;
  }
  ?&gt;
  </code></pre>
  
  <p>How can I change the <code>cURL downloading process</code> to the <code>client-site</code>?</p>