I have a view that is rendered with ContentType of "application/msword". For users this appears as download file. Now, I would like to save this document server side. How could get I access the rendered document server side ?
using (var stream = new MemoryStream())
using (var writer = new StreamWriter(stream))
{
var viewContext =
new ViewContext(
filterContext.Controller.ControllerContext,
vResult.View,
vResult.ViewData,
vResult.TempData,
writer);
vResult.View.Render(viewContext, writer);
writer.Flush();
}