Why this action results an empty file on client side ??
public FileResult download() { MemoryStream stream = new MemoryStream(); StreamWriter writer = new StreamWriter(stream); FileStreamResult fs = new FileStreamResult(stream, "text/plain"); fs.FileDownloadName = "file.txt"; writer.WriteLine("this text is missing !!! :( "); writer.Flush(); stream.Flush(); return fs; }