FileServerExtensions.UseFileServer Method

Definition

Overloads

UseFileServer(IApplicationBuilder)

Enable all static file middleware (except directory browsing) for the current request path in the current directory.

UseFileServer(IApplicationBuilder, FileServerOptions)

Enable all static file middleware with the given options

UseFileServer(IApplicationBuilder, Boolean)

Enable all static file middleware on for the current request path in the current directory.

UseFileServer(IApplicationBuilder, String)

Enables all static file middleware (except directory browsing) for the given request path from the directory of the same name

UseFileServer(IApplicationBuilder)

Source:
FileServerExtensions.cs
Source:
FileServerExtensions.cs

Enable all static file middleware (except directory browsing) for the current request path in the current directory.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseFileServer(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseFileServer (this Microsoft.AspNetCore.Builder.IApplicationBuilder app);
static member UseFileServer : Microsoft.AspNetCore.Builder.IApplicationBuilder -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseFileServer (app As IApplicationBuilder) As IApplicationBuilder

Parameters

Returns

Remarks

Files are served from the path specified in WebRootPath or WebRootFileProvider which defaults to the 'wwwroot' subfolder.

Applies to

UseFileServer(IApplicationBuilder, FileServerOptions)

Source:
FileServerExtensions.cs
Source:
FileServerExtensions.cs

Enable all static file middleware with the given options

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseFileServer(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Microsoft::AspNetCore::Builder::FileServerOptions ^ options);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseFileServer (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Microsoft.AspNetCore.Builder.FileServerOptions options);
static member UseFileServer : Microsoft.AspNetCore.Builder.IApplicationBuilder * Microsoft.AspNetCore.Builder.FileServerOptions -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseFileServer (app As IApplicationBuilder, options As FileServerOptions) As IApplicationBuilder

Parameters

Returns

Applies to

UseFileServer(IApplicationBuilder, Boolean)

Source:
FileServerExtensions.cs
Source:
FileServerExtensions.cs

Enable all static file middleware on for the current request path in the current directory.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseFileServer(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, bool enableDirectoryBrowsing);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseFileServer (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, bool enableDirectoryBrowsing);
static member UseFileServer : Microsoft.AspNetCore.Builder.IApplicationBuilder * bool -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseFileServer (app As IApplicationBuilder, enableDirectoryBrowsing As Boolean) As IApplicationBuilder

Parameters

enableDirectoryBrowsing
Boolean

Should directory browsing be enabled?

Returns

Remarks

Files are served from the path specified in WebRootPath or WebRootFileProvider which defaults to the 'wwwroot' subfolder.

Applies to

UseFileServer(IApplicationBuilder, String)

Source:
FileServerExtensions.cs
Source:
FileServerExtensions.cs

Enables all static file middleware (except directory browsing) for the given request path from the directory of the same name

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseFileServer(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, System::String ^ requestPath);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseFileServer (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, string requestPath);
static member UseFileServer : Microsoft.AspNetCore.Builder.IApplicationBuilder * string -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseFileServer (app As IApplicationBuilder, requestPath As String) As IApplicationBuilder

Parameters

requestPath
String

The relative request path.

Returns

Remarks

Files are served from the path specified in WebRootPath or WebRootFileProvider which defaults to the 'wwwroot' subfolder.

Applies to