Reputation: 28284
I uploaded xml file in my cakephp in img/files directory
app->webroot->files->Myfile.xml
and I want to call it from my controller like this
$file = "/files/Myfile.xml";
I am not sure is this the correct path from the controller ot not of course controller is in app->controllers->my_controller
thanks
Upvotes: 0
Views: 104
Reputation: 72961
Use one of the CakePHP Core Configuration Constants.
WWW_ROOT
for example:
$file = WWW_ROOT . "files/MyFiles.xml";
Upvotes: 3