Hi,

i have a problem with the FCK Editor.
Can't find the right way to get the file uploader working correctly.

My Drupal installation looks like this:

/sites/domain1
/sites/domain2
/sites/domain3
/sites/default
/sites/all

modules:

Can't find the right way to get the file uploader working correctly.

My Drupal installation looks like this:

/sites/domain1.de
/sites/sub.domain2.de
/sites/sub.domain3.de
/sites/default
/sites/all

the modules are here:

/sites/domain1.de/modules/fckeditor
/sites/sub.domain2.de/modules/fckeditor
/sites/sub.domain3.de/modules/fckeditor
/sites/default

path to the config.php:
modules/fckeditor/fckeditor/editor/filemanager/connectors/php/config.php

path to the files should be:

sub.domain2.de/files/

Whats the right path for

$Config['UserFilesPath'] =
$Config['UserFilesAbsolutePath'] =

I tried nearly everything but nothing worked...

Please HELP !

Comments

Billy Chimpson’s picture

Got it !

$Config['Enabled'] = true ;

// Path to user files relative to the document root.
$Config['UserFilesPath'] = '/sites/'.$_SERVER["SERVER_NAME"].'/files/';

// Fill the following value it you prefer to specify the absolute path for the
// user files directory. Useful if you are using a virtual directory, symbolic
// link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
// Attention: The above 'UserFilesPath' must point to the same directory.
$Config['UserFilesAbsolutePath'] = '/home/mydomain/htdocs/sites/'.$_SERVER["SERVER_NAME"].'/files/' ;

I hope you have less problems with this than me!

David

drasgardian’s picture

I'm not sure if this is exactly the same problem, but it may help you or someone else.

I've got a multi-site drupal install and because there are several users working on drupal sites, the sites/ folder contains symlinks to the site-specific files in various users's home directories.

filemanager-config.php has a line that looks like this

$drupal_path = "../../../";

whch is used when trying to find the bootstrap.inc file.

This of course wasn't working because of my symlinks, so I changed that line to this

$drupal_path = $_SERVER['DOCUMENT_ROOT'];

and now it works fine.

I didn't need to change the $Config['UserFilesPath'] and $Config['UserFilesAbsolutePath'] as the paths are picked up from what is configured within the drupal fckeditor configuration.

wwalc’s picture

Status: Active » Fixed

crashovermind:
You should avoiding this setting:

$Config['Enabled'] = true ;

this is really a strong security risk.

Try including filemanager.config.php as the readme says, check users permissions, fckeditor profile and so on.
If it still doesn't work, then the problem may be in finding the path by filemanager.config.php (thanks to drasgardian for pointing this issue out).
Try to set the $drupal_path in the filemanager.config.php to the absolute server path to your drupal installation, e.g: /home/login/public_html/drupal/.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

scarer’s picture

Version: 6.x-1.1-beta2 » 6.x-1.3

I used sym links for my drupal multisite install so I had to do something like this instead:

$string = $_SERVER['REQUEST_URI'];
$strings = explode("/", $string);
// SECURITY: You must explicitly enable this "connector". (Set it to "true").
// WARNING: don't just set "$Config['Enabled'] = true ;", you must be sure that only
// authenticated users can access this file or use some kind of session checking.
$Config['Enabled'] = true ;

// Path to user files relative to the document root.
//$Config['UserFilesPath'] = '/sites/'. $_SERVER['SCRIPT_NAME'] .'/files/';
$Config['UserFilesPath'] = '/sites/myservername.' . $strings[1] .'/files/';

sprior’s picture

I think a MUCH safer thing to do (though still pretty much a hack) is to modify sites/all/modules/fckeditor/filemanager.config.php in the CheckAuthentication function. Right above the final:
if (!isset($bootstrapFileFound) || ($bootstrapfilefound) {

Put the following:

if (!isset($bootstrapFileFound) || ($bootstrapfilefound) {
$drupal_path= "path_to_drupal_install"; // OR code to figure out what it is maybe from the __FILE__ constant
$bootstrapFileFound = file_exists($drupal_path . "/includes/bootstrap.inc");
}

Then you can follow the regular instructions for putting the include in fckeditor/editor/filemanager/connectors/php/config.php

By doing this you won't be hardcoding $Config['Enabled'] = true ; which is a security problem.