methodiHttpResponse.SendFile
procedure SendFile(const aPhysicalFile: string);
Serves a file from disk as the body and sets Content-Type from its extension. Answers 404 and leaves the body empty if the file is not there, so a vanished file degrades rather than raising. aPhysicalFile IS A PHYSICAL PATH AND IS USED AS GIVEN. Nothing here derives it from the request, and nothing validates it: building it by concatenating anything from iHttpRequest is how a path traversal is written. Map requests to files with AddFile / AddFiles, which register the physical path up front, or validate the result yourself against a canonicalised root. THE FILE IS OPENED HERE AND READ AS IT IS SENT, not read into memory: the wire session pulls it in bounded chunks, paced by what the transport says it can take (iAppTransportFlow / iAppSessionDrain in StreamSec.Mobile.AsyncTLSServer), so a large download costs a handle and a few chunks. The file stays open, closed to writers, until the response has gone. Prefer SendFileRange all the same: it honours a Range header, which is what lets a client resume instead of starting again.