We have an existing MVC app that has an Action on a controller that returns a file for download, however when we use this same action as an MVC Function in C1, we get the following error.
"Error: OutputStream is not available when a custom TextWriter is used."
Here are the code snippets.
From the View inside the C1 website
Is there a way to have C1 understand this Controller Action is not returning a View, but rather a File for download?
Other suggestions?
"Error: OutputStream is not available when a custom TextWriter is used."
Here are the code snippets.
From the View inside the C1 website
@Html.ActionLink("download", "DownloadReport")
in the the controllerpublic ActionResult DownloadReport()
{
byte[] content = null;
///... bunch of code that builds the report in memory
///...
///...
/// send the byte array content back down the wire to the client
return File(content, System.Net.Mime.MediaTypeNames.Application.Pdf, "Report.pdf");
}
If we change ActionResult to FileResult as the return type, the MVC Function will not appear in the page. No error is logged. Is there a way to have C1 understand this Controller Action is not returning a View, but rather a File for download?
Other suggestions?