title: How do I save a file using the response header filename with cURL?
body: <p>This question relates to the command line version of cURL.</p>
  
  <p>I'm trying to download a file from a CGI script.</p>
  
  <pre><code>http://example.com/perl/dl.pl?ID=2
  </code></pre>
  
  <p>Using a browser the filename comes up as <code>remotefilename.gz</code>.
  cURL wants to save the file as <code>dl.pl?ID=2</code>.</p>
  
  <p>How do I get cURL to save to a file with the filename from the response header?</p>