title: Extracting email attachment filename : Content-Disposition vs Content-type
body: <p>I am working on a script that will handle email attachments. I see that, most of the time, both <code>content-type</code> and <code>content-disposition</code> headers have the filename, but I have seen cases where only one had proper encoding or valid mime header.</p>
  
  <p>Is there a preferred header to use to extract the file name? If so, which one?</p>