phpf防止越权下载文件

if (file_exists($sFilePath)) {

            $sTitle = $sFilePath;
            $sTitle = strrchr($sTitle, "/");
            $sTitle = ltrim($sTitle, '/');
            $this->downloadFile($sTitle, $sFilePath);

        }

  其实就是切割   如用户上传路径可能是    /Data/wwwroot/edu/xxx/bbb   这时我们只需要bbb,切割符合的就行了

posted @ 2017-02-25 22:39  人间最美二月天  阅读(467)  评论(0编辑  收藏  举报