Fail to open excel, error for ZipFile


#1

Hi,

Input the attached file and open it
workbook = new Workbook(inputStream);

got the error:

Caused by: com.aspose.cells.CellsException: Error for ZipFile
at com.aspose.cells.zazr.a(Unknown Source)
at com.aspose.cells.a.f.zj.(Unknown Source)
at com.aspose.cells.a.f.zj.a(Unknown Source)
at com.aspose.cells.zru.a(Unknown Source)
at com.aspose.cells.zjl.a(Unknown Source)
at com.aspose.cells.zjl.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.(Unknown Source)
at

Thanks for help!

Ruhongtf02780252.zip (132.9 KB)


#2

@ruhongcai,
We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSJAVA-43023 – Fail to open XLTX from stream, Exception "error for ZipFile"

#3

@ruhongcai,

While we evaluate your issue (as we logged a ticket for it), could you try loading the file using filepath, it will work fine:
e.g
Sample code:

Workbook workbook = new Workbook("f:\\files\\tf02780252.xltx");


#4

@ruhongcai,

We have tested using your provided file and found the issue was caused by Jdk’s zip APIs and cannot be fixed by Aspose.Cells. To verify this issue, please test below code without reference to or using Aspose.Cells:
e.g
Sample code:

ZipInputStream zis = new ZipInputStream(new FileInputStream("J43023.xltx"));
while(true) {
ZipEntry ze = zis.getNextEntry();
if(ze == null) {
break;
}
System.out.println(ze.getName());
zis.skip(1024);
zis.closeEntry();
}

You will also get exception by executing the code with the template file.