OfficeIMO.Zip
3.4.5
Prefix Reserved
dotnet add package OfficeIMO.Zip --version 3.4.5
NuGet\Install-Package OfficeIMO.Zip -Version 3.4.5
<PackageReference Include="OfficeIMO.Zip" Version="3.4.5" />
<PackageVersion Include="OfficeIMO.Zip" Version="3.4.5" />
<PackageReference Include="OfficeIMO.Zip" />
paket add OfficeIMO.Zip --version 3.4.5
#r "nuget: OfficeIMO.Zip, 3.4.5"
#:package OfficeIMO.Zip@3.4.5
#addin nuget:?package=OfficeIMO.Zip&version=3.4.5
#tool nuget:?package=OfficeIMO.Zip&version=3.4.5
OfficeIMO.Zip - safe ZIP traversal primitives
OfficeIMO.Zip provides dependency-light ZIP traversal primitives for ingestion scenarios.
Install
dotnet add package OfficeIMO.Zip
Quick start
using OfficeIMO.Zip;
ZipTraversalResult result = ZipTraversal.Traverse("archive.zip", new ZipTraversalOptions {
MaxEntries = 1000,
MaxPhysicalEntries = 5000,
MaxDepth = 8,
MaxTotalUncompressedBytes = 100L * 1024L * 1024L
});
foreach (ZipEntryDescriptor entry in result.Entries) {
Console.WriteLine($"{entry.FullName} ({entry.UncompressedLength} bytes)");
}
foreach (ZipTraversalWarning warning in result.Warnings) {
Console.WriteLine($"{warning.EntryPath}: {warning.Warning}");
}
What it does
- Enumerates entries deterministically.
- Applies path safety guards for relative traversal, absolute paths, and drive paths.
- Enforces compressed archive size, physical and accepted entry counts, depth, uncompressed-size, per-entry-size, and compression-ratio limits.
- Reports traversal warnings for rejected or limited entries.
MaxEntries counts accepted entries. MaxPhysicalEntries counts every ZIP entry, including directories and rejected paths, before entry metadata is opened. The defaults are 5,000 accepted entries, 10,000 physical entries, and 512 MiB compressed source bytes. A malformed source or one above either physical bound raises InvalidDataException. The path and stream overloads copy input into a bounded private snapshot so validation and parsing see the same bytes. If you create ZipArchive yourself, use an immutable source and call ZipTraversal.ValidateSource before opening it; the archive overload can limit processing only after the caller's archive has materialized its entries.
Examples
Enumerate accepted files only
using OfficeIMO.Zip;
IReadOnlyList<ZipEntryDescriptor> entries = ZipTraversal.Enumerate("evidence.zip",
new ZipTraversalOptions {
DeterministicOrder = true,
IncludeDirectoryEntries = false,
MaxEntries = 2500
});
foreach (var entry in entries.Where(entry => !entry.IsDirectory)) {
Console.WriteLine($"{entry.FullName} depth={entry.Depth} bytes={entry.UncompressedLength}");
}
Traverse a stream with defensive limits
using OfficeIMO.Zip;
await using var upload = File.OpenRead("upload.zip");
ZipTraversalResult result = ZipTraversal.Traverse(upload, new ZipTraversalOptions {
MaxDepth = 6,
MaxEntries = 500,
MaxEntryUncompressedBytes = 20L * 1024L * 1024L,
MaxTotalUncompressedBytes = 100L * 1024L * 1024L,
MaxCompressionRatio = 100
});
if (result.Warnings.Count > 0) {
foreach (var warning in result.Warnings) {
Console.WriteLine($"{warning.EntryPath}: {warning.Warning}");
}
}
Use traversal output before extraction
using OfficeIMO.Zip;
var traversal = ZipTraversal.Traverse("incoming.zip");
var safeJsonEntries = traversal.Entries
.Where(entry => entry.FullName.EndsWith(".json", StringComparison.OrdinalIgnoreCase))
.ToList();
foreach (var entry in safeJsonEntries) {
Console.WriteLine($"Queue {entry.FullName} for a separate extraction step.");
}
Boundaries
- This package owns ZIP traversal policy primitives.
- Reader integration belongs in
OfficeIMO.Reader.Zip. - It is not a general archive extraction framework.
Targets and license
- Targets:
netstandard2.0,net8.0,net10.0. - License: MIT.
- Repository: EvotecIT/OfficeIMO
Dependency footprint
- External: None beyond platform compression APIs.
- OfficeIMO:
OfficeIMO.Core. Traversal policy, safety limits, descriptors, and warnings are first-party.
See the complete OfficeIMO package map for related formats and conversion paths.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.7.2
- OfficeIMO.Core (>= 3.4.5)
-
.NETStandard 2.0
- OfficeIMO.Core (>= 3.4.5)
-
net10.0
- OfficeIMO.Core (>= 3.4.5)
-
net8.0
- OfficeIMO.Core (>= 3.4.5)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on OfficeIMO.Zip:
| Package | Downloads |
|---|---|
|
OfficeIMO.Reader.Zip
ZIP adapter for OfficeIMO.Reader modular ingestion. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.4.5 | 502 | 10/10/2026 |
| 3.4.4 | 377 | 9/27/2026 |
| 3.4.3 | 342 | 9/12/2026 |
| 3.4.2 | 231 | 9/9/2026 |
| 3.4.1 | 240 | 9/7/2026 |
| 3.4.0 | 185 | 9/6/2026 |
| 3.3.0 | 168 | 9/2/2026 |
| 3.2.7 | 182 | 8/29/2026 |
| 3.2.6 | 277 | 8/22/2026 |
| 3.2.5 | 279 | 8/21/2026 |
| 3.2.4 | 269 | 8/19/2026 |
| 3.2.3 | 192 | 8/17/2026 |
| 3.2.2 | 390 | 8/13/2026 |
| 3.2.1 | 314 | 8/11/2026 |
| 3.2.0 | 475 | 8/7/2026 |
| 3.1.1 | 213 | 8/7/2026 |
| 3.1.0 | 180 | 8/6/2026 |
| 3.0.3 | 665 | 7/27/2026 |
| 3.0.2 | 185 | 7/26/2026 |
| 3.0.1 | 533 | 7/26/2026 |