When a request arrives from a web browser, FoxWeb sets the default directory to the location where the requested script resides. The Server.Transfer method, on the other hand, simply makes sure that the called script is compiled and then uses VFP's DO command to call it. It does not execute fw_enter, or change the default directory. If you want, you can achieve this behavior by adding the following command at the top of all scripts that may get called with the Server.Transfer methods:
SET DEFAULT TO JUSTPATH(SYS(16))
Sent by Alan Harris-Reid on 01/02/2003 02:11:50 PM:
When I call a .fwx script via the IE address bar, a form action argument, or <a href=...>, the Foxpro default directory changes to the directory containing the script. However, when I call the same script via Server.transfer(), the default directory does not change, and remains that of the calling script or program. This poses problems when I wish to use relative pathing to call data, programs, reports, etc. from respective subfolders of the main program root folder.
* Does Fw_enter.prg still run when a script is called via Server.transfer()?
* How can I call a script using Server.transfer(), and still have the default folder change to that of the called script?
* Alternatively, how can I call a script from any folder (not via Server.transfer), but keep the program root as the default folder?