StaticFileOptions StaticFileOptions StaticFileOptions Class


Options for serving static files

public class StaticFileOptions : Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptionsBase
type StaticFileOptions = class
    inherit SharedOptionsBase
Public Class StaticFileOptions
Inherits SharedOptionsBase


StaticFileOptions() StaticFileOptions() StaticFileOptions()

Defaults to all request paths

StaticFileOptions(SharedOptions) StaticFileOptions(SharedOptions) StaticFileOptions(SharedOptions)

Defaults to all request paths


ContentTypeProvider ContentTypeProvider ContentTypeProvider

Used to map files to content-types.

DefaultContentType DefaultContentType DefaultContentType

The default content type for a request if the ContentTypeProvider cannot determine one. None is provided by default, so the client must determine the format themselves.

FileProvider FileProvider FileProvider

The file system used to locate resources

(Inherited from SharedOptionsBase)
OnPrepareResponse OnPrepareResponse OnPrepareResponse

Called after the status code and headers have been set, but before the body has been written. This can be used to add or change the response headers.

RequestPath RequestPath RequestPath

The relative request path that maps to static resources.

(Inherited from SharedOptionsBase)
ServeUnknownFileTypes ServeUnknownFileTypes ServeUnknownFileTypes

If the file is not a recognized content-type should it be served? Default: false.

SharedOptions SharedOptions SharedOptions

Options common to several middleware components

(Inherited from SharedOptionsBase)

Applies to