Zip exception.Can't locate end of central directory record. Possible wrong file format or archive is corrupt.

Hello Syncfusion team,


we are facing this exception while opening some word documents using blazor syncfusion, we didn't face this issue while using our legacy app created using syncfusion vue js components.

Syncfusion.Compression.Zip.ZipException: Zip exception.Can't locate end of central directory record. Possible wrong file format or archive is corrupt.

   at Syncfusion.Compression.Zip.ZipArchive.Open(Stream stream, Boolean closeStream)

   at Syncfusion.DocIO.DLS.Convertors.DocxParser.Read(Stream docStream, WordDocument document)

   at Syncfusion.DocIO.DLS.WordDocument.OpenDocx(Stream stream)

   at Syncfusion.DocIO.DLS.WordDocument.OpenInternal(Stream stream, FormatType formatType, String password)

   at Syncfusion.DocIO.DLS.WordDocument.Open(Stream stream, FormatType formatType)

   at Syncfusion.DocIO.DLS.WordDocument..ctor(Stream stream, FormatType type)

   at Syncfusion.Blazor.DocumentEditor.WordDocument.Load(Stream stream, ImportFormatType type)


I found this article https://support.syncfusion.com/kb/article/9417/why-is-zip-exception-thrown-when-processing-word-document-in-essential-docio is there a possible solution to do, as our users are saying they can open the same file if they are using the legacy vue js without any error.


Thanks

Ahmed


1 Reply

DS Dhanush Sekar Syncfusion Team May 15, 2024 07:42 PM UTC

Hi Ahmed,


We suspect that issue might be due to stream position or stream length when loading stream in document editor load API. Please check this case in your application. 

Can you please share the word document ? it will be helpful to validate further and provide you the solution at earliest.


Regards.

Dhanush Sekar


Loader.
Up arrow icon