StaticFileOptions Class

Definition

Options for serving static files

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

Constructors

StaticFileOptions()

Defaults to all request paths

StaticFileOptions(SharedOptions)

Defaults to all request paths

Properties

ContentTypeProvider

Used to map files to content-types.

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. http://www.w3.org/Protocols/rfc2616/rfc2616-sec7.html#sec7

FileProvider

The file system used to locate resources

(Inherited from SharedOptionsBase)
HttpsCompression

Indicates if files should be compressed for HTTPS requests when the Response Compression middleware is available. The default value is Compress.

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.

OnPrepareResponseAsync

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.

RedirectToAppendTrailingSlash

Indicates whether to redirect to add a trailing slash at the end of path. Relative resource links may require this.

(Inherited from SharedOptionsBase)
RequestPath

The relative request path that maps to static resources. This defaults to the site root '/'.

(Inherited from SharedOptionsBase)
ServeUnknownFileTypes

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

SharedOptions

Options common to several middleware components

(Inherited from SharedOptionsBase)

Applies to