AsyncDynamicZip
Example of dynamically generating a zip file download from ASP.NET, with minimal threading and memory usage.
Install / Use
/learn @StephenClearyExamples/AsyncDynamicZipREADME
Async Zip-on-the-Fly
Example of dynamically generating a zip file download from ASP.NET, with minimal threading and memory usage.
Specifically, with this code:
- No file is ever completely in memory at any time. As files are read, they are immediately compressed and sent to the browser.
- No threads are ever blocked waiting on reads or writes. The fully-asynchronous code permits threads to return to the thread pool unless they are actually executing code.
There are five examples in this repository, each on its own branch:
- net6-ziparchive - ASP.NET (.NET 6.0) using the built-in
ZipArchive - core-ziparchive - ASP.NET (.NET Core 1.0) using the built-in
ZipArchive - core-dotnetzip - ASP.NET (.NET Core 1.0) using
DotNetZip(which restricts this application to the full .NET Framework) - full-ziparchive - ASP.NET (.NET 4.6.1) using the built-in
ZipArchive - full-dotnetzip - ASP.NET (.NET 4.6.1) using
DotNetZip
The core-ziparchive and full-ziparchive branches include a workaround for a bug in the ZipArchive class on those platforms. The net6-ziparchive does not include that workaround since the bug has been fixed.
The net6-ziparchive, core-ziparchive, and core-dotnetzip branches include their own FileCallbackResult to asynchronously stream output on demand.
Related Skills
node-connect
349.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
Security Score
Audited on Jul 12, 2025
