Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top