DirectoryBrowserMiddleware Class

Enables directory browsing

Namespace
Microsoft.AspNetCore.StaticFiles
Assemblies
  • Microsoft.AspNetCore.StaticFiles

Syntax

public class DirectoryBrowserMiddleware
class Microsoft.AspNetCore.StaticFiles.DirectoryBrowserMiddleware

Constructors

DirectoryBrowserMiddleware(Microsoft.AspNetCore.Http.RequestDelegate, Microsoft.AspNetCore.Hosting.IHostingEnvironment, System.Text.Encodings.Web.HtmlEncoder, Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Builder.DirectoryBrowserOptions>)

Creates a new instance of the SendFileMiddleware.

Arguments:
public DirectoryBrowserMiddleware(RequestDelegate next, IHostingEnvironment hostingEnv, HtmlEncoder encoder, IOptions<DirectoryBrowserOptions> options)

Methods

Invoke(Microsoft.AspNetCore.Http.HttpContext)

Examines the request to see if it matches a configured directory. If so, a view of the directory contents is returned.

Return type:System.Threading.Tasks.Task
public Task Invoke(HttpContext context)