Hi,
Would anyone have a controller example that prompts for a file download from a string? I'm trying function that returns a System.Web.Mvc.FileContentResult, but the contents get displayed in the gadget instead of getting downloaded.
Here is the return line of the function:
return File(new System.Text.UTF8Encoding().GetBytes(sb.ToString()), "text/plain", String.Format("{0}_{1}.{2}", StoreExportBase.GetExportFriendlyName(t), DateTime.Now.ToString("dd_mm_yyy_hh-ss_tt"), extension) );
Thanks,
Brad
Maybe this thread in stackoverflow could have your answer: http://stackoverflow.com/questions/3206682/stream-file-using-asp-net-mvc-filecontentresult-in-a-browser-with-a-name
Hi,
Would anyone have a controller example that prompts for a file download from a string? I'm trying function that returns a System.Web.Mvc.FileContentResult, but the contents get displayed in the gadget instead of getting downloaded.
Here is the return line of the function:
Thanks,
Brad