title: action that returns a file in MVC3
body: <p>So, I don't get what I still should to to make a file downloadable within the action.</p>
  
  <p>So, here is the controller that I have. Everything seems to work fine, except that I never receive any file to download client-side.</p>
  
  <pre><code>    &lt;HttpPost()&gt;
      Function meetingCP(idCont As Integer, idOpp As Integer, schedule As String) As FileResult
          Dim id As Integer = 0
          Dim iCSFile As StringBuilder = New StringBuilder()
          Dim startDate As Date = schedule
          Dim endDate As Date = startDate.AddMinutes(30)
  
          iCSFile.AppendLine("BEGIN:VCALENDAR")
          iCSFile.AppendLine("VERSION:2.0")
          iCSFile.AppendLine("METHOD:REQUEST")
  
        [bla bla bla]
  
          iCSFile.AppendLine("DESCRIPTION:Reminder")
          iCSFile.AppendLine("END:VALARM")
          iCSFile.AppendLine("END:VEVENT")
          iCSFile.AppendLine("END:VCALENDAR")
  
          Dim StreamWriter As StreamWriter = New StreamWriter("C:\MvcApplication4\MvcApplication4\Content\test.ics")
          StreamWriter.WriteLine(iCSFile)
          StreamWriter.Close()
  
  
          Return File(iCSFile.ToString, "text/plain", "MeetingRequest.ics")
          'Return File(Encoding.UTF8.GetBytes(iCSFile.ToString()), "text/plain", "MeetingRequest.ics")
      End Function
  </code></pre>
  
  <p>And this action is called by ajax. Might that be the problem?</p>
  
  <pre><code>function meetCP(idCont, idOpp) {
      var meetCPSelect = ("#meettime" + idCont);
      var dateTime = $(meetCPSelect).val();
      $.ajax({
          url: '@Url.Action("meetingCP")',
          type: 'POST',
          data: { idCont: idCont, idOpp: idOpp, schedule: dateTime },
          success: function (result) { }
      });
  };
  </code></pre>