0

I am getting error when trying to read excel file from Request.Files (InputStream), but error came up just from a windows server machine. any idea about something missing?

EPPlus version is 4.5.2.1

Error Line:

    foreach (string file in Request.Files) {
        HttpPostedFileBase hpf = Request.Files[file] as HttpPostedFileBase;
        using (var xls = new ExcelPackage(hpf.FileStream))

  //<--- ERROR LINE

Error message:

Object reference not set to an instance of an object.
 Source: EPPlus
 StackTrace:    at OfficeOpenXml.Packaging.ZipPackage..ctor(Stream stream) at OfficeOpenXml.ExcelPackage.Load(Stream input, Stream output, String Password)
   at OfficeOpenXml.ExcelPackage..ctor(Stream newStream)
abhinavsinghvirsen
  • 1,853
  • 16
  • 25

1 Answers1

0

The issue was solved, the reason for the issue was the files were encrypted and when uploading they could not be read.