wwRequest::GetPhysicalPath

Returns the physical path to a script mapped page or an executable DLL file. The physical path is a great tool for capturing the system specific path of script mapped pages, so you can capture the location of the page for further parsing.

For example, Web Connection uses the Physical Path to capture scripts and uses the physical path to read in the original page, then parses it using the wwVFPScript script parser. Regardless of where the page was called from the physical path always returns the correct location for the file.

For example:

http://localhost/wconnect/scriptdemo.wcs

returns:

c:\inetpub\wwwroot\wconnect\scriptdemo.wcs

o.getphysicalpath()

Remarks

If you're using any remote servers you have to be careful about the physical path. The physical path will always be returned with a Web server specific path. If you're running remotely via a DCOM object or remote filebased server, C:\inetpub\wwwroot\myapp is not a valid path to pull the script page from, so you need to fix up the path.

You can do this by usign assiging a drive override which can use VFP's FORCEDRIVE() or a full path override by using FULLPATH to adjust the path for the full location.

Physical path is a parsed value that guarantees to hold either the ISAPI extension's name or the name of the script that was executed. ISAPI does not provide this functionality natively and splits this between PATH_INFO and PATH_TRANSLATED and SCRIPT_NAME. Use GetPhysicalPath() to retrieve this value safely, but be aware that this variable does not exist in ASP or ISAPI directly.


See also:

Class wwrequest | wwRequest::GetLogicalPath

© West Wind Technologies, 1996-2018 • Updated: 09/29/99
Comment or report problem with topic