ResolvePath Method  
 

Resolve a path to its full virtual or local file name.

Syntax

object.ResolvePath( ClientId, SourcePath, ResolvedPath, [IsVirtual] )

Parameters

ClientId
An integer that identifies the client session.
SourcePath
A string that specifies the name of the path to resolve. This may either be a virtual path, or a path to a local file name or directory.
ResolvedPath
A string that will contain the resolved path when the method returns.
IsVirtual
An optional Boolean parameter that specifies if the source path is a virtual path or local path.

Return Value

A value of zero is returned if the path could be resolved. Otherwise, a non-zero error code is returned which indicates the cause of the failure.

Remarks

The ResolvePath method is used to resolve a local file name or directory to obtain its virtual path name, or obtain the full path name of a file or directory that is mapped to a virtual path.  If the IsVirtual parameter is omitted or is False, the SourcePath parameter is considered to be a path to a local file or directory and the ResolvedPath parameter will contain the virtual path. If the IsVirtual parameter is True, then the SourcePath parameter is considered to be a virtual path and the ResolvedPath parameter will contain the full path to the local file or directory that the virtual path is mapped to

A virtual path for the client is either relative to the server root directory, or the client home directory if the client was authenticated as a restricted user. These virtual paths are what the client will see as an absolute path on the server. For example, if the server was configured to use "C:\ProgramData\MyServer" as the root directory, and the SourcePath parameter was specified as "C:\ProgramData\MyServer\Documents\Research", this method would return the virtual path to that directory as "/Documents/Research".

If the client session was authenticated as a restricted user, then the virtual path is always relative to the client home directory instead of the server root directory. This is because restricted users are isolated to their own home directory and any subdirectories. For example, if restricted user "John" has a home directory of "C:\ProgramData\MyServer\Users\John" and the SourcePath parameter was specified as "C:\ProgramData\MyServer\Users\John\Accounting\Projections.pdf" this method would return the virtual path as "/Accounting/Projections.pdf".

If the SourcePath parameter specifies a file or directory outside of the server root directory, this method will fail and the last error code will be set to stErrorInvalidFileName. This method can only be used with authenticated clients. If the ClientId parameter specifies a client session that has not been authenticated, this method will fail and the last error code will be stErrorAuthenticationRequired.

See Also

LocalPath Property, VirtualPath Property