title: File name changes after opening downloaded excel file in .Net C# MVC
body: <p>I am trying to export data as Excel in my C#.Net MVC Application. I have used <code>return file()</code> in <code>Actionresult</code>. The file is returned and downloaded successfully.</p>
  
  <p>But there is error while opening file and the file names gets changed when it is opened.
  Downloaded file name is <code>ExportFilterCRMdoctorRequest.xls</code> but after opening it changes to <code>Book1</code>.
  code for Exporting file:</p>
  
  <pre><code>public ActionResult ExportFilterCRMdoctorRequest() 
          {
              var stream = new MemoryStream();
              var serializer = new XmlSerializer(typeof(List&lt;CDRFilterCRMDoctorRequest&gt;));
  
              //We load the data
              List&lt;CDRFilterCRMDoctorRequest&gt; data = (List&lt;CDRFilterCRMDoctorRequest&gt;)Session["filterCRMRequestList"]; //Retriving data from Session
  
              //We turn it into an XML and save it in the memory
              serializer.Serialize(stream, data);
              stream.Position = 0;
  
              //We return the XML from the memory as a .xls file
              return File(stream, "application/vnd.ms-excel", "ExportFilterCRMdoctorRequest.xls");
          }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/RJ1fQ.jpg" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/fSFlN.jpg" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/6pOUu.jpg" alt="The file name got changed to &quot;Book1&quot;"></p>