Reputation:
I want return XSLT format in mvc what is the mime type for this?
public FileResult DownloadTemplate(string templateCode)
{
try
{
var template = _manager.GetTemplateByCode(templateCode);
const string fileName = "Template";
return File(template.Value, System.Net.Mime.MediaTypeNames.Application.Octet, fileName);
}
catch (Exception ex)
{
return null;
}
}
Upvotes: 0
Views: 173
Reputation: 24125
You can use text/xsl
for that purpose:
public FileResult DownloadTemplate(string templateCode)
{
try
{
var template = _manager.GetTemplateByCode(templateCode);
const string fileName = "Template";
return File(template.Value, "text/xsl", fileName);
}
catch (Exception ex)
{
return null;
}
}
Upvotes: 0
Reputation: 338326
The File
helper's signature is
FileContentResult File(byte[] fileContents, string contentType, string fileDownloadName)
This should be enough info to answer your question.
Upvotes: 1