1

我正在尝试在用户必须登录才能访问文件库的安全环境中实现响应式文件管理器。为了确保用户只能在登录会话处于活动状态时访问上传的文件,我将文件管理器上传文件夹放在 public_html 上方。

$config = array(
/*
|-------------------------------------------------------------------
| DON'T TOUCH (base url (only domain) of site).
|-------------------------------------------------------------------
| without final / (DON'T TOUCH)
*/
'base_url' => ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] && ! in_array(strtolower($_SERVER['HTTPS']), array( 'off', 'no' ))) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'],

/*
|-------------------------------------------------------------------
| path from base_url to base of upload folder
|-------------------------------------------------------------------
| with start and final /
*/
'upload_dir' => '/../Uploads/content/',

/*
|--------------------------------------------------------------------
| relative path from filemanager folder to upload folder
|--------------------------------------------------------------------
| with final /
*/
'current_path' => '../../../../Uploads/content/',

/*
|--------------------------------------------------------------------
| relative path from filemanager folder to thumbs folder
|--------------------------------------------------------------------
|
| with final /
| DO NOT put inside upload folder
*/
'thumbs_base_path' => '../../../../Uploads/thumbs/',

使用上述配置时,我不断收到以下错误:

有错误!上传文件夹没有。检查您的 config.php 文件。

应用程序的结构如下:

-来自公众的升级

--httpdocs (public_html)

- -我的应用程序

- - 行政

-----库

--------文件管理器目录

请记住,上层包含一个“上传”目录,即上传文件夹。

是否甚至可以将上传文件夹放在 public_html 上方?我尝试了不同的路径,也将服务器路径设置为 base_path 但仍然没有结果。

如果您能帮助我解决这个问题,那就太好了。

谢谢

4

1 回答 1

1

Filemanager directoryUplevel是 5 个级别。

'upload_dir' => '../../../../../Uploads/content/',
'current_path' => '../../../../../Uploads/content/',
'thumbs_base_path' => '../../../../../Uploads/thumbs/',

确保contentthumbs文件夹在其中创建Uploads并具有写入权限。

现在,当您转储图像的路径时,该Uploads文件夹不在外部public_html而是在内部myapplication..那么路径应该是

'upload_dir' => '../../../Uploads/content/',
'current_path' => '../../../Uploads/content/',
'thumbs_base_path' => '../../../Uploads/thumbs/',
于 2018-02-07T22:30:10.163 回答