Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken Excel fail generated when writing to not seekable stream #9

Closed
aboryczko opened this issue May 25, 2022 · 8 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@aboryczko
Copy link

Hi,

I've tried to use this library to stream Excel files on the fly via ASP.NET Core. My use case prohibits me with caching it in memory and I end up using the raw HTTP response stream. The file generated seems ok at first, but when I load it with Excel it tries to repair it and without any data loss the file is opened.
The only difference between a correct file and the broken one is that the underlying ZIP file has the general purpose bit flag set to (bit 3).
I know that this is more of an Excel issue but did anyone have any luck working around that?

@aboryczko
Copy link
Author

I guess it's not totaly Excel related because I've exchanged the SharpCompress library for the .NET internal compression implementation and my generated files work correctly.

@aboryczko
Copy link
Author

so there is an error in the compression library that adds some strange bytes in the middle of the content every N bytes. I will go continue this thread there.

@aboryczko
Copy link
Author

@salvois if it would be ok with you I could create a PR that would replace SharpCompress with the built-in .NET Core implementation and bumped it to v2.0. It worked fine for me.

@salvois
Copy link
Owner

salvois commented May 30, 2022

Hi @aboryczko , last time I checked, the built-in compressor in .NET failed to produce a ZIP64 with content larger that 4 GiB considered valid by Excel. It refused to open it altogether. If this is still the case, unfortunately I cannot switch the underlying compression library.
Have you tried this too?
Thanks,
Salvl

@Erior
Copy link

Erior commented Jun 29, 2022

Would be nice if you can try out the 0.32.1 release of sharpcompress, that was linked to this issue

@salvois
Copy link
Owner

salvois commented Jun 30, 2022

Hi @Erior ,
many thanks for pointing that out and for your help, I will try it next week!
Salvo

salvois pushed a commit that referenced this issue Jul 11, 2022
@salvois
Copy link
Owner

salvois commented Jul 11, 2022

Hi @aboryczko , @Erior ,
the issue seems to be solved using SharpCompress 0.32.1.
I have just released LargeXlsx 1.5.1 with the updated dependency.
Please have a try and let me know.
Thanks for your contribution!
Salvo

@salvois salvois self-assigned this Jul 11, 2022
@salvois salvois added the bug Something isn't working label Jul 11, 2022
@aboryczko
Copy link
Author

Thanks everyone, I can also confirm that the issue has been resolved :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants