title: How can I call an MVC FileContentResult by Jquery and get it to prompt the user to save on it's return?
body: <p>I'm generating a CSV from an MVC 3 website and using a FileContentResult to pass this to the user.  This worked great but it took 30 seconds for the csv to generate and therefore 30 seconds before the prompt to save was given to the user.</p>
  
  <pre><code>    public virtual FileContentResult GetSpreadsheet(string id)
      {
          var service = new SpreadsheetService();
          var result = service.GetCSV();
          return File(new System.Text.UTF8Encoding().GetBytes(result.Message), "text/csv", "Report123.csv");
      }
  </code></pre>
  
  <p>So I thought I'd just call it via JQuery - but this (unsurprisingly!) just dumps the CSV to the page.  </p>
  
  <pre><code>            $.post("/Home/GetSpreadsheet/" + id, null, function (data) {
                  $('#resultDiv').html(data);
              });
  </code></pre>
  
  <p>Does anyone know how I'd generate the prompt to save now I've got the data back?  Thanks</p>