title: How to get filename from Content-Disposition in headers
body: <p>I am downloading a file with Mechanize and in response headers there is a string:</p>
  
  <pre><code>Content-Disposition: attachment; filename=myfilename.txt
  </code></pre>
  
  <p>Is there a quick standard way to get that filename value?
  What I have in mind now is this:</p>
  
  <pre><code>filename = f[1]['Content-Disposition'].split('; ')[1].replace('filename=', '')
  </code></pre>
  
  <p>But it looks like a quick'n'dirty solution.</p>