Soukoku.Extensions.FileProviders.Zip 2.0.1

dotnet add package Soukoku.Extensions.FileProviders.Zip --version 2.0.1                
NuGet\Install-Package Soukoku.Extensions.FileProviders.Zip -Version 2.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soukoku.Extensions.FileProviders.Zip" Version="2.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Soukoku.Extensions.FileProviders.Zip --version 2.0.1                
#r "nuget: Soukoku.Extensions.FileProviders.Zip, 2.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Soukoku.Extensions.FileProviders.Zip as a Cake Addin
#addin nuget:?package=Soukoku.Extensions.FileProviders.Zip&version=2.0.1

// Install Soukoku.Extensions.FileProviders.Zip as a Cake Tool
#tool nuget:?package=Soukoku.Extensions.FileProviders.Zip&version=2.0.1                

About

Allows using zip files as a FS provider for aspnet core's StaticFiles middleware. A single zip file can serve as a root file system when used this way.

Getting It

In an asp.net core project, install the Soukoku.Extensions.FileProviders.Zip NuGet package.

Example

Assuming there's a zip file you want to load, you can do something like the following


// inside the Program.cs or Startup.cs
IApplicationBuilder app = ...

var zipProvider = new ZipFileProvider(@"path\to\my\zip-file.zip");
var options = new FileServerOptions
{
    FileProvider = provider,
    RequestPath = "/test", // optional
    EnableDirectoryBrowsing = true,
};
// required for extension-less files
options.StaticFileOptions.ServeUnknownFileTypes = true;
app.UseFileServer(options);
  

Then go to the url http://mysite/test in the browser to see the zip file content.

Sample Site

A sample asp.net core site is included in the solution that uses an old PDF.js dist zip file. Run it or look at the Startup.cs file to see how it's configured.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
.NET Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.1 89 9/8/2024
2.0.0 138 3/6/2024
1.1.3 29,007 10/17/2018
1.1.2 967 3/15/2018
1.1.1 832 11/19/2017
1.1.0 828 11/16/2017
1.0.1 834 11/14/2017
1.0.0 826 11/13/2017