Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Relative path to wwwroot for C++ Builder
#4
>>I am trying to access a subfolder (myfolder)
>>I created in wwwroot following this reference article:

If I read the article correctly it looks to explain absolute and relative paths in terms of serving content via the web server.


>>This for sure does not work as a relative path
>>in C++ builder: "\\myfolder\\myfile.xml" It is
>>referring to C:\myfoler\myfile.xml

This would refer to accessing your files internally from a Windows executable.  To use relative paths in this case you would need to know your current directory which generally defaults to the application path.  This can change if run from a short cut, run as a service, or changed in code.

>>This one is close: "myfolder\\myfile.xml". But
>>is referring to the application path were the
>>.exe is running!

This looks correct to me based on the above.


I use something like gGetAppPath()+"wwwroot\\myfoler\\myfile.xml" for file paths in case the current directory isn't set to the application folder.
Reply


Messages In This Thread
RE: Relative path to wwwroot for C++ Builder - by MJS@mjs.us - 06-18-2024, 10:12 AM

Forum Jump:


Users browsing this thread: 4 Guest(s)