title: Exporting a CSV file from MVC3 - Internet Explorer Issue
body: <p>I'm trying to create a CSV export for some data I have. Seems simple enough, and works beautifully in Firefox and Chrome, but in Internet Explorer I just get a message saying the file could not be downloaded. No other error messages, no break in Visual Studio, no debugging information that I can find.</p>
  
  <p>Here's my code. Perhaps I'm doing something wrong?</p>
  
  <pre><code>public ActionResult ExportStudentsCSV(IEnumerable&lt;Student&gt; students) {
      MemoryStream output = new MemoryStream();
      StreamWriter writer = new StreamWriter(output, System.Text.Encoding.UTF8);
      writer.WriteLine("Username,Year Level,School Name,State,Date Joined");
      foreach (Student student in students) {
          writer.WriteLine(
                      "\"" + student.username
              + "\",\"" + student.year_level
              + "\",\"" + student.SchoolName
              + "\",\"" + student.state
              + "\",\"" + student.join_date
              + "\""
          );
      }
      writer.Flush();
      output.Seek(0, SeekOrigin.Begin);
  
      return File(output, "text/csv", "Students_" + DateTime.Now.ToShortDateString().Replace('/', '-') + ".csv");
  }
  </code></pre>
  
  <p>And I'm calling this function in my controller with:</p>
  
  <pre><code>    return ExportStudentsCSV(model.StudentReport.StudentList);
  </code></pre>