mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-06 05:27:05 +00:00
Zip file ArchiveFactory.Open throws exception for Legacy compressed zip file #505
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Malshan90 on GitHub (Mar 3, 2022).
Hi,
The zip file I'm using use Zip 2.0 (Legacy) compression. When I try to open it via ArchiveFactory.Open, I get below exception,
"Cannot determine compressed stream type. Supported Archive Formats: Zip, GZip, Tar, Rar, 7Zip"
I'm using ArchiveFactory Open(string filePath, ReaderOptions? options = null) method. All AES encrypted file can be open and extract without any issues.
Could you guide me here, This is the first time we got Legacy files from a client. Thing is we do need to support legacy method in our system as any new client can be sending legacy compressed files.
Thanks in Advance.
@adamhathcock commented on GitHub (Mar 3, 2022):
This would need investigating what Magic Bytes are in the file that are unmatched to what SharpCompress knows about.
Do they work if you use ZipArchive.Open directly?
@Malshan90 commented on GitHub (Mar 3, 2022):
Sorry, I found the issue and that was our engineer has used an iteration and instead of directly sending the zip file he's been sending bunch of other files as well. I just reviewed the code and removed the buggy code.
It works perfectly.
Sorry to bother you.
Keep it up the good work.!