Sometimes when downloading excel file from website, we get unknown file type (*.File). To fix this, just add the content-type of file that you want to download. exp : “application/vnd.ms-excel”.
sample code :
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName.Trim() + ".xls");