Tinymec4文件管理器错误:有错误!根文件夹不存在

时间:2014-04-04 10:14:00

标签: php symfony tinymce-4 file-manager

我使用文件管理器插件(tinymce)上传图片。但是我能够将图像上传到特定文件夹,但在图片列表中它给了我错误:有错误!根文件夹不存在。 我保留文件管理器插件的路径是 -

\web\bundles\stfalcontinymce\vendor\tinymce\plugins\filemanager  

上传文件夹的路径是 -

 web\tinymceuploads

所以我在文件管理器的config.php中传递参数就像 -

 $base_url="http://localhost/example/web/app_dev.php/web"; //url base of site if you want only relative url leave empty
    $upload_dir = '/tinymceuploads/'; // path from base_url to upload base dir
    $current_path = '/../../../tinymceuploads/'; // relative path from filemanager folder to upload files folder

但是在点击上传按钮后的图片列表中我收到错误: 有错误!根文件夹不存在。请尽快帮助我。它几乎吃了我的脑袋。 感谢

3 个答案:

答案 0 :(得分:0)

1.假设您的tinymce文件夹位于http://localhost/projectname/tinymce/

2.在tinymce下创建文件夹图像,例如:tinymce / images

3.转到文件夹位置tinymce / plugins / filemanager / config.php

4.转到15到20附近的线 - 它看起来像这样

BASE_URL =" HTTP://本地主机/项目名称/&#34 ;;

$ upload_dir =' tinymce / images /';

$ current_path =' ../../ images /';

5.添加此行

$ root =' / tinymce /&#39 ;; $ root =' ../ tinymce /';

保存并运行项目。

希望它有效......

答案 1 :(得分:0)

假设您的目录如下所示:

BASE_URL = “HTTP://本地主机/项目名称/”; //基目录

|

| ________工作目录//您现在正在使用

|

| ________ tinymce目录

配置错误:

base_url="http://localhost/projectname/";

$upload_dir = 'http://localhost/projectname/tinymce/images/';

$root='http://localhost/projectname/tinymce';

正确配置:

base_url="http://localhost/projectname/";

$upload_dir = '../tinymce/images/'; // from working folder to tinymce/images

$current_path = '../../images/';  // tinymce/plugins/filemanager to  path tinymce/images

$root='../tinymce/';

您的上传和根目录差异仅为 / images

它对我有用..

答案 2 :(得分:0)

请像这样调整你的编码php

$root = rtrim($_SERVER['DOCUMENT_ROOT'],'/'); // don't touch this configuration

//**********************
//Path configuration
//**********************
// In this configuration the folder tree is
// root
//   |- tinymce
//   |    |- source <- upload folder
//   |    |- js
//   |    |   |- tinymce
//   |    |   |    |- plugins
//   |    |   |    |-   |- filemanager
//   |    |   |    |-   |-      |- thumbs <- folder of thumbs [must have the write permission]

$base_url="http://localhost"; //url base of site if you want only relative url leave empty
$upload_dir = '/sik/assets/tinymce/source/'; // path from base_url to upload base dir
$current_path = '../../../../source'; // relative path from filemanager folder to upload files folder

$MaxSizeUpload=100; //Mb