title: How to Read the Uploaded Excel File using NPOI with out storing in the server or in the Project
body: <p>My sample Code is  below using the NPOI.dll. I can read the EXCEL File (i.e. Excel would be stored in the system like <code>D:/Jamal/Test.xls</code>. Then the dll is easily reading the content, but I need to read the uploaded Excel file without storing it in any place before.The HTTPPOSTEDFILEBASE excelfile has the value for the Excel file but I need to know how to read it using NPOI dlls</p>
  
  <pre class="lang-c# prettyprint-override"><code>public List&lt;string&gt; SendInvitesExcelFile1(List&lt;String&gt; CorrectMailIDs,
                                       ListInvites Invites, HttpPostedFileBase excelfile)
  {
          List&lt;string&gt; mailids = new List&lt;string&gt;();
          //string filename = (excelfile.FileName).ToString();
          HSSFWorkbook hssfwb;
      //   using (FileStream file = new FileStream(@"D:\test.xls", FileMode.Open, FileAccess.Read))
  
           using (FileStream file = new FileStream(excelFile.FileName, FileMode.Open, FileAccess.Read))
          { 
               hssfwb = new HSSFWorkbook(file);
          }
  
          Sheet sheet = hssfwb.GetSheet("sheet1");
          for (int row = 0; row &lt;= sheet.LastRowNum; row++)
          {
              if (sheet.GetRow(row) != null) //null is when the row only contains empty cells 
              {
                  mailids.Add(sheet.GetRow(row).GetCell(0).ToString());
              }
          }
          return mailids;
  </code></pre>