{"action":"opened","issue":{"url":"https://api.github.com/repos/dotnetcore/NPOI/issues/75","repository_url":"https://api.github.com/repos/dotnetcore/NPOI","labels_url":"https://api.github.com/repos/dotnetcore/NPOI/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/dotnetcore/NPOI/issues/75/comments","events_url":"https://api.github.com/repos/dotnetcore/NPOI/issues/75/events","html_url":"https://github.com/dotnetcore/NPOI/issues/75","id":348422620,"node_id":"MDU6SXNzdWUzNDg0MjI2MjA=","number":75,"title":"Error to open download file","user":{"login":"apis3445","id":7475390,"node_id":"MDQ6VXNlcjc0NzUzOTA=","avatar_url":"https://avatars2.githubusercontent.com/u/7475390?v=4","gravatar_id":"","url":"https://api.github.com/users/apis3445","html_url":"https://github.com/apis3445","followers_url":"https://api.github.com/users/apis3445/followers","following_url":"https://api.github.com/users/apis3445/following{/other_user}","gists_url":"https://api.github.com/users/apis3445/gists{/gist_id}","starred_url":"https://api.github.com/users/apis3445/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apis3445/subscriptions","organizations_url":"https://api.github.com/users/apis3445/orgs","repos_url":"https://api.github.com/users/apis3445/repos","events_url":"https://api.github.com/users/apis3445/events{/privacy}","received_events_url":"https://api.github.com/users/apis3445/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-07T17:47:13Z","updated_at":"2018-08-07T17:47:13Z","closed_at":null,"author_association":"NONE","body":"Hi! I try to read a excel file that was send by email. The code is\r\n`using (var stream = new FileStream(fullPath, FileMode.Open, FileAccess.Read))\r\n            {\r\n                try\r\n                {\r\n                    if (sFileExtension == \".xls\")\r\n                    {\r\n                        HSSFWorkbook hssfwb = new HSSFWorkbook(stream); //This will read the Excel 97-2000 formats  \r\n                        sheet = hssfwb.GetSheetAt(0); //get first sheet from workbook  \r\n                        headerRow = sheet.GetRow(0);\r\n                    }\r\n                    else\r\n                    {\r\n                        XSSFWorkbook hssfwb = new XSSFWorkbook(stream); //This will read 2007 Excel format  \r\n                        sheet = hssfwb.GetSheetAt(0); //get first sheet from workbook\r\n                        headerRow = sheet.GetRow(0);\r\n\r\n                    }\r\n                }\r\n                catch (EncryptedDocumentException e)\r\n                {\r\n                    // Checking of .xls file with password protected.\r\n                    logger.LogError(e.Message);\r\n                    return \"Ocurrio un error al leer el archivo. El archivo puede estar protegido\";\r\n                }\r\n                catch (Exception ex)\r\n                {\r\n                    logger.LogError(ex.Message);\r\n                    return \"Ocurrio un error al leer el archivo.\";\r\n                }\r\n            `\r\n\r\nand I get this exception\r\n`  at ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.Read(Byte[] buffer, Int32 offset, Int32 count)\r\n   at ICSharpCode.SharpZipLib.Zip.ZipInputStream.BodyRead(Byte[] buffer, Int32 offset, Int32 count)\r\n   at NPOI.OpenXml4Net.Util.ZipInputStreamZipEntrySource.FakeZipEntry..ctor(ZipEntry entry, ZipInputStream inp)\r\n   at NPOI.OpenXml4Net.Util.ZipInputStreamZipEntrySource..ctor(ZipInputStream inp)\r\n   at NPOI.OpenXml4Net.OPC.ZipPackage..ctor(Stream filestream, PackageAccess access)\r\n   at NPOI.OpenXml4Net.OPC.OPCPackage.Open(Stream in1)\r\n   at NPOI.Util.PackageHelper.Open(Stream is1)\r\n   at NPOI.XSSF.UserModel.XSSFWorkbook..ctor(Stream is1)\r\n   at Caltic.Core.Gestion.IndicadorValores.<Importar>d__9.MoveNext() in D:\\docs\\0214net\\Caltic\\Caltic\\Core\\Gestion\\IndicadorValores.cs:line 111`\r\n\r\nIf I save the excel again and I don't use the protected file I can read the file without errors"}}
{"actor":{"display_login":"apis3445"}}