Сопоставление диска в elfinder внутри папки files

  1. Здесь я картирую D диск в elfinder
  2. Я не могу открыть файлы.

Вот мой код

$opts = array(
// 'debug' => true,
'roots' => array(
array(
'driver'        => 'LocalFileSystem',   // driver for accessing file system (REQUIRED)
'path'          => 'D:/pdf/', // path to files (REQUIRED)
'URL'           => 'D:/pdf/',  // URL to files (REQUIRED)
'accessControl' => 'access'    // disable and hide dot starting files (OPTIONAL)
)
)
);

2

Решение

Обычно браузер будет открывать только URL, а не путь. Мы должны преобразовать путь в URL.

Если вы хотите сопоставить диск (диск D), создайте виртуальный каталог в XAMMP.
Добавьте приведенный ниже код в httpd-vhosts.conf

<VirtualHost *:80>
<Directory "D:/pdf">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
Require all granted
</Directory>
ServerAdmin anbu@local.dev
DocumentRoot "D:/pdf"ServerName local.dev
</VirtualHost>

Теперь перезагрузите ваш сервер.

изменить URL в коде удара

$opts = array(
// 'debug' => true,
'roots' => array(
array(
'driver'        => 'LocalFileSystem',   // driver for accessing file system (REQUIRED)
'path'          => 'D:/pdf/', // path to files (REQUIRED)
'URL'           => 'http://local.dev',  // URL to files (REQUIRED)
'accessControl' => 'access'    // disable and hide dot starting files (OPTIONAL)
)
)
);

надеюсь это сработает 🙂

2

Другие решения

Ваш URL неверен. Пожалуйста, смотрите пример в документация:

$opts = array(
'locale' => '',
'roots'  => array(
array(
'driver' => 'LocalFileSystem',
'path'   => '/path/to/files/',
'URL'    => 'http://localhost/to/files/'
)
)
);
0