Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Static method: HttpResponseContent File(string, string, int?, DateTime?)

Declaration

public static HttpResponseContent File(
    string filePath,
    string contentType = null,
    int? maxAge = 3600,
    DateTime? ifModifiedSince = null
)

Summary

Returns the specified file from the local file system using the specified MIME content type to the client.

Parameters

stringfilePath Full path and filename of the file to return.
stringcontentType MIME type to use in the Content-Type header. If null (the default), the first kilobyte is looked at to choose between the plaintext and the octet-stream content type.
int?maxAge Specifies the value for the CacheControl max-age header on the file served. Set to null to prevent this header being sent.
DateTime?ifModifiedSince If specified, a 304 Not Modified will be served if the file's last modified timestamp is at or before this time.