VirtualPath Property  
 

Return the virtual path to the local file or directory that is the target of the current command.

Syntax

object.VirtualPath [ = filename ]

Remarks

The VirtualPath property returns the virtual path to a local file name or directory specified by the client as an argument to a standard FTP command. For example, if the client sends the RETR command to the server, this property will return the complete virtual path to the file that the client wants to download. This property will only return a value for those standard commands that perform some action on a file or directory, otherwise it will return an empty string.

Setting this property allows you to effectively redirect the client to use a different file than the one that was actually requested. If the path is absolute, then it will be used as-is. If the path is relative, it will be relative to the current working directory for the active client session. If this property is set to an empty string, then the server will revert to using the actual file or directory name specified by the command.

This property should only be set within an OnCommand event handler, and only for those commands that perform an action on a file or directory. If the current command does not target a file or directory, setting this property will cause an exception to be raised by the control. Exercise caution when using this property to redirect the server to use a different file than the one requested by the client; changing the target file may cause the client to behave in unexpected ways.

Data Type

String

See Also

LocalPath Property, ResolvePath Method, OnCommand Event