How to configure File Manager plugin?

3.7k views Asked by At

I'm using tinyMce for textarea, and with this I'm using File Manager Plugin but I haven't had luck with the configuration file.

This is some of the original content

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

What I got is this

$base_url="http://localhost/atravesfree";
$upload_dir = '/atravesfree/public/source/';
$current_path = '';

And this is the result, I have an image inside the folder but it's not shown. I know I need to set the "current_path" but I don't know how do that exactly.

File Manager Result

I'm using a framework called "Freekore" and this is how the order of the folders look like

This is the location of the filemanager folder
-root [localhost/atravesfree - G:/wamp/www/atravesfree]
    |-public
        |-_HTML
            |-themes
                |-mytheme
                    |-js
                        |-plugins
                            |-filemanager

This is the location where I have, and where I want, the uploaded files
-root [localhost/atravesfree - G:/wamp/www/atravesfree]
    |-public
        |-source

Thank you for your help.


After I solve this I got this error "the path is not writable", the reason was that the "thumbs" folder didn't have write permissions.

3

There are 3 answers

2
Binary101010 On BEST ANSWER

Try This

$dir='http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);
$dir=str_replace('filemanager', '', $dir);
$base_url="http://www.site.com";
$upload_dir = $dir.'source/';
$current_path = '../source/';
$thumbs_base_path = '../thumbs/';

obviously replace dir and your site. Thumbs is optional.

0
wangai On

In case someone stumbles on this like I did, these settings worked for me

The URL for my project is set up like this http://127.0.0.1/project/branch/public/

$base_url = "";
$upload_dir = "/project/branch/public/path/to/tinymce/upload_dir/";
$current_path = "/../../upload_dir/";

make sure you follow setup instructions in their github repo

0
Faiyaz Alam On

I have this code in my cakephp 2:

$root = rtrim($_SERVER['DOCUMENT_ROOT'],'/'); // don't touch this configuration        
$root = $root."/cakephp/app/webroot";

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

I have followed this structure:

 // root(cakephp/app/webroot)
//   |- tinymce
//   |    |- source <- upload folder
//   |    |- js
//   |    |   |- tinymce
//   |    |   |    |- plugins
//   |    |   |    |-   |- filemanager
//   |    |   |    |-   |-      |- thumbs <- folder of thumbs [must have the write permission]

Hope that this helps to other user.