TStaticModule.DefineContentType Method
Sets the Content-Type header of the response based on the extension of the given file name, unless a content type has already been set.
Remarks
If the response already has a content-type header, or if no content type can be determined for the file extension, the header is left unchanged. The content type is resolved through FindContentType.
Syntax
Unit: Sparkle.Module.Static
class procedure TStaticModule.DefineContentType(C: THttpServerContext; const FileName: string); static;
Parameters
| <-> | Parameter | Type | Description |
|---|---|---|---|
| C | THttpServerContext | The context of the request being processed. | |
| const | FileName | string | The name of the file whose extension determines the content type. |