title: C# File download with Firefox issue over https
body: <p>I have a very weird issue with Firefox only (works fine with IE &amp; Chrome) when I try to download a file stored in SQL DB. Issue only comes up when the user tries to save the file on their machine as it cannot recognize the extension of the file. It works fine if the user tries to open it and browser is able to detect if its a word, excel, or pdf file. Here is my code block:</p>
  
  <pre><code>Attachments attach = AttachmentsSession[e.Item.ItemIndex] as Attachments;
  string extension = attach.Extension;
  byte[] bytFile = attach.AttachmentData;
  string fileName = attach.Name;
  
  Response.ClearHeaders();
  Response.Clear();
  Response.Buffer = true;
  
  if (extension == ".doc")
  {
     Response.ContentType = "application/vnd.ms-word";
     Response.AddHeader("content-disposition", "attachment;filename=" + fileName);
  }
  
  else if (extension == ".docx")
  {
     Response.ContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
      Response.AddHeader("content-disposition", "attachment;filename=" + fileName);
  }
  
  Response.Charset = "";
  Response.BinaryWrite(bytFile);
  HttpContext.Current.ApplicationInstance.CompleteRequest();
  Response.End();
  </code></pre>