Support the ongoing development of Laravel.io →
Configuration
Last updated 2 years ago.
0

repeater09 said:

I am trying to get the Filemanager plugin to work on my localhost Laravel 4 project. http://www.responsivefilemanager.com/

I have the plugin in place located in public/js/rte/plugins and I have the config.php file located in the same location. I am trying to get the config.php to point to my public/img folder so I can select and upload images to it. I am having some issues with it because I normally just use blade to complete this task and not to familiar with relative paths. Has anyone got this working with Laravel 4 that can maybe explain a little further?

Here is the config.php and how i have it set at the moment. When i dump everything it seems to be correct.

if($_SESSION["verify"] != "FileManager4TinyMCE") die('forbidden');

$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="/local_search/public"; //url base of site if you want only relative url leave empty
$upload_dir = '/img/'; // path from base_url to upload base dir
$current_path = '/img/'; // relative path from filemanager folder to upload files folder

You can use this settings, this is an example of my settings

<?php
if($_SESSION["verify"] != "FileManager4TinyMCE") die('forbidden');

// $root = rtrim($_SERVER['DOCUMENT_ROOT'],'/'); // don't touch this configuration
$root = rtrim(__FILE__,'/'); // don't touch this configuration
$root = substr($root, 0, strpos($root, DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . 'dashboard' . DIRECTORY_SEPARATOR));

//**********************
//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
$base_url = $_SERVER['PHP_SELF'];
$base_url = substr($base_url, 0, strpos($base_url, '/public/dashboard/'));
$base_url = 'http://' . $_SERVER['SERVER_NAME'] . $base_url;
//$upload_dir = '/tinymce/source/'; // path from base_url to upload base dir
$upload_dir = '/public/uploads/pages'; // path from base_url to upload base dir

//$current_path = '../../../../source/'; // relative path from filemanager folder to upload files folder
$current_path = '../../../../../uploads/pages'; // relative path from filemanager folder to upload files folder

My folder in public/uploads/pages

You can use like my code, i create for dynamic folder Please locate your folder and change if needed Thank you

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

repeater09 repeater09 Joined 18 Apr 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.