Hi
We have ASP.Net MVC application. There is excel file download functionality supported in our web application.
Previously *.xls file was created using Excel Application and was getting downloaded, but as Server side Automation is not recommended for many reasons, I am doing one POC application which creates Excel file *.xls using Open XML SDK 2.0 ( I have used Productivity Tool to generate the code to create this file on Server).
Now File is getting downloaded without any problem, as ActionResult returns following code.
return File(fileBytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "TestFile.xls");
Now when user opens this downloaded TestFile.xls file, it gives him the warning that "The file format and extension of 'TestFile.xls' don't match. The file could be corrupted or unsafe. Unless you trust the source, don't open it. Do you want to open it anyway? Yes/No/Help options.
As we need to support Office 2007 as well as Office 2013 clients, I have to download *.xls file. ( If I download *.xlsx file, it gives error and file cannot be opened for office 2007 clients)
Please advise on how to suppress or get rid of the warning message for Office 2013 clients.
Best Regards