function URLPathToFilePath(aRootPath: string; aSubPath: string): string;

Using the base path on disk and a URL (excluding the host), this function converts and merges the two into a physical path on disk. It does not check to see if the resulting file actually exists.

URLPathToFilePath verifies that the resulting path:

Example

xURI := TInURI.Create(WebApplication.ReferringURLLast);
xLocalFile := URLPathToFilePath(gSC.ContentPath, xURI.Path + xURI.Document);