Get Docroot directory
Added by Fahmi Noorain almost 11 years ago
Hi,
I've a simple question, but did not know the answer.
How can I get the docroot directory in WResource. I know it can be done from WApplication.
But I used WResource to do JSON webservices and I need to reply some pictures URL (located in docroot) in response.
Hope someone can help me.
Thanks!
Replies (2)
RE: Get Docroot directory - Added by Wim Dumon almost 11 years ago
Hi Fahmi,
Are you talking about inside of handleRequest()? That's currently not possible AFAIK. May I suggest to pass the docroot to your WResource upon construction of the WResource class, and store it in a member variable?
Best regards,
Wim.
RE: Get Docroot directory - Added by Fahmi Noorain almost 11 years ago
Yup, that it exactly what I meant. Thank for you suggestion, seems this the easier way to pass docroot right now.