title: Download file from URL using CURL
body: <p>I try to download file using a php-script from an URL like the following:</p>
  
  <pre><code>http://www.xcontest.org/track.php?t=2avxjsv1.igc
  </code></pre>
  
  <p>The code I use looks like the following, but it produces empty download files only:</p>
  
  <pre><code>$DLFile= "testfile.igc";
  $DLURL="http://www.xcontest.org/track.php?t=2avxjsv1.igc"; 
  $fp = fopen ($DLFile, 'w+');
  $ch = curl_init($DLURL);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  curl_setopt($ch, CURLOPT_FILE, $fp);
  curl_exec($ch);
  curl_close($ch);
  fclose($fp);
  </code></pre>
  
  <p>An other strange thing is when entering the URL in the web browser I don't get the file.  It can I could only download the file when clicking the link on the <a href="http://www.xcontest.org/world/en/flights/detail:pepino/31.10.2012/07:20" rel="noreferrer">web site</a>!.</p>
  
  <p>Any advice is very appreciated!</p>