Codeigniter - dynamically getting relative/absolute path outside of application folder

后端 未结 1 908
忘掉有多难
忘掉有多难 2020-12-08 01:52

I am attempting to have a temporary cache folder of sorts just outside of and at the same level as the application folder. This is for storing images for a couple moments be

相关标签:
1条回答
  • 2020-12-08 02:37

    In the index.php file in the root, most useful paths are defined so that you can use them within the rest of the code. Have you tried FCPATH in this case?

    FCPATH   -> '/'
    BASEPATH -> '/system/'
    APPPATH  -> '/application/'
    

    UPDATE: As mentioned in the comments, the path examples above are only to give an overview. To increase the security of your project, BASEPATH and APPPATH wouldn't be inside FCPATH and instead outside of the public www/root directory.

    0 讨论(0)
提交回复
热议问题