title: Classic ASP Content-type XLS Chrome downloads as .asp file for some users
body: <p>I have a classic asp website which includes the ability to export/download table data as an excel file (.xls). This is done by redirecting the user to a new page with this block of code in place of the usual HTML headers:</p>
  
  <pre><code>sub PutInTopOfXLS(FileName)
      Response.Buffer = TRUE
      Response.CharSet="UTF-8"
      Response.CodePage=65001
      Response.ContentType = "application/vnd.ms-excel"
      Response.AddHeader "Content-Disposition", "attachment;filename=" &amp; FileName%&gt;
      &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
      &lt;html xmlns:x="urn:schemas-microsoft-com:office:excel"&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; 
          &lt;style&gt;
          &lt;!--table
          br {mso-data-placement:same-cell;}
          tr {vertical-align:top;}
          --&gt;
          &lt;/style&gt;
      &lt;/head&gt;
      &lt;body&gt;  
  &lt;%end sub
  </code></pre>
  
  <p>this works fine for all users (or at least no problems have been reported) on Firefox, Internet Explorer and Safari (for both Mac and Windows) and it works fine for my development machine using Chrome (20.0.1132.57). However, my QA person reports that on one particular report out of several on the site, it always downloads on Chrome with the actual code page name ReportFileName.asp and then he gets a Windows error about no file association for .asp files. If he actually selects Open with Excel, the correct file has been downloaded. I asked another person in our office to download Chrome and she is has no problem; the file downloads as {filename}.xls and opens normally.</p>
  
  <p>I'm very confused because the fact that for the QA person, it is only affecting this one report would suggest that the problem is in the specific report. However, the fact that two other users with the same version of Chrome are not experiencing the problem would suggest it is something in his Chrome setting.</p>
  
  <p>I haven't had any luck googling for a solution or searching on SO so I thought I'd throw the question out there and see if anyone has any ideas.</p>
  
  <p>Thanks very much for your assistance.</p>