title: Download csv file from url and save on server with username password
body: <p>I want to download a csv file from a url and save that on my server.
  But the URL requires a username/password.</p>
  
  <p>And I also want to include a timeout, so that it will not try to download it longer than 30 seconds.</p>
  
  <p>I currently tried this, but that is missing the username / password.</p>
  
  <p>How can I achive this?</p>
  
  <pre><code>file_put_contents("file.csv", fopen("http://url.com/path/to/file.csv", 'r'));
  </code></pre>