Internet Direct (Indy) Version 9.0.1 Beta
TIdHTTPServer.ServeFile
Requests a file transfer to the HTTP client.

function ServeFile(AThread: TIdPeerThread; ResponseInfo: TIdHTTPResponseInfo; aFile: TFileName): cardinal; virtual;
Parameters
AThread: TIdPeerThread
The peer thread requesting the file.

ResponseInfo: TIdHTTPResponseInfo
The response object used to write headers for the HTTP response.

aFile: TFileName
The file name requested.

Returns
Cardinal - Number of bytes written to the peer thread connection.

Description
ServeFile is a Cardinal function used to send the contents of a file on the HTTP server to the HTTP client represented by the peer thread connection.

ServeFile uses MIMETable to determine the content type for the requested file.

ServeFile uses AResponseInfo to write the HTTP response headers, and writes the content of the file in AFile to the peer thread Connection.