title: PDF Handler : content-disposition filename
body: <p>I am outputting a PDF file in a Web browser (IE8) <code>HttpContext.Response.writefile(fileName)</code> and it works great. When I try to save the file, it will give me the name of the ashx handler as a default. I would like to actually pass the real name.</p>
  
  <p>I tried to add header information as follow:</p>
  
  <pre><code>context.Response.AddHeader("content-disposition", "attachment; filename=" + fileInfo.Name);
  </code></pre>
  
  <p>And it works but I do not want the user to have to choose between open and save, i want the file to open normally and if the user chooses to save it then the dialog would give him/her the default filename.</p>
  
  <p>I tried also:</p>
  
  <pre><code>context.Response.AddHeader("content-disposition", "inline; filename=" + fileInfo.Name);
  </code></pre>
  
  <p>Or just, like <a href="http://www.hanselman.com/blog/TheContentDispositionSagaControllingTheSuggestedFileNameInTheBrowsersSaveAsDialog.aspx">Scott Hanselman suggested in his blog</a>.</p>
  
  <pre><code>context.Response.AddHeader("content-disposition", "filename=" + fileInfo.Name);
  </code></pre>
  
  <p>None of those work for me. Does anybody have any ideas?</p>