FckEditor 6.1 file upload and server config problems

cloudmaker - April 8, 2008 - 06:04

Hello.
I'm having trouble uploading file images and browsing those images using Fckeditor.
If I try to upload a file, I can select one from my local computer and I notice that my browser tells me: -
/node/12/edit?destination=admin%2Fcontent%2Fnode.

Then I try to brows the image and I get the following error: -

The server didn't send back a proper XML response. Please contact your system administrator.

XML request error: OK (404)

Requested URL:
http://myslte.com/sites/all/modules/fckeditor/fckeditor/editor/filemanager/browser/default/../../connectors/php/connector.php?ServerPath=%2Fsites%2Fdefault%2Ffiles&Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F&uuid=1207633832207

Response text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
  <head>
    <title>Page not found | mysite.com</title>

So I have looked at all of the docs about /filemanager/connectors/php/config.php and I think I've made the right changes.

I have also looked the File Browser setting for Fckeditor but I'm a bit lost.

The default setting look OK to me but perhaps they need to be customized.
I have left the Path to Upload files as is, viz: - %b%f/
And I have left the Absolute path to uploaded files: as is viz: - %d%b%f/

Any help offered would be greatly appreciated.

FckEditor 6.1 file upload and server config problems

matkeane - April 8, 2008 - 09:06

Hi,

I ran into this one as well at first. If I remember correctly, you need to make sure that uploads are enabled in the sites/all/modules/fckeditor/fckeditor/editor/filemanager/connectors/php/config.php file _and_ make sure that in your Drupal site settings file, you have enabled the cookie domain and set it to something useful (like your domain). Oh, and make sure that users are allowed to use the upload feature under 'access permissions'. You may also find it useful to sacrifice a goat at midnight...

Matthew

FckEditor 6.1

cloudmaker - April 9, 2008 - 03:46

cloudmaker

Thanks so much for your support I really appreciate it.

Heres what my config file looks like.

global $Config ;

// 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'] = '/userfiles/' ;

// 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'] = '' ;
require_once "../../../../../filemanager.config.php";
// Due to security issues with Apache modules, it is recommended to leave the
// following setting enabled.
$Config['ForceSingleExtension'] = true ;

// Perform additional checks for image files.
// If set to true, validate image size (using getimagesize).
$Config['SecureImageUploads'] = true;

// What the user can do with this connector.
$Config['ConfigAllowedCommands'] = array('QuickUpload', 'FileUpload', 'GetFolders', 'GetFoldersAndFiles', 'CreateFolder') ;

// Allowed Resource Types.
$Config['ConfigAllowedTypes'] = array('File', 'Image', 'Flash', 'Media') ;

// For security, HTML is allowed in the first Kb of data for files having the
// following extensions only.
$Config['HtmlExtensions'] = array("html", "htm", "xml", "xsd", "txt", "js") ;

// After file is uploaded, sometimes it is required to change its permissions
// so that it was possible to access it at the later time.
// If possible, it is recommended to set more restrictive permissions, like 0755.
// Set to 0 to disable this feature.
// Note: not needed on Windows-based servers.
$Config['ChmodOnUpload'] = 0777 ;

// See comments above.
// Used when creating folders that does not exist.
$Config['ChmodOnFolderCreate'] = 0777 ;

$Config['AllowedExtensions']['File'] = array('7z', 'aiff', 'asf', 'avi', 'bmp', 'csv', 'doc', 'fla', 'flv', 'gif', 'gz', 'gzip', 'jpeg', 'jpg', 'mid', 'mov', 'mp3', 'mp4', 'mpc', 'mpeg', 'mpg', 'ods', 'odt', 'pdf', 'png', 'ppt', 'pxd', 'qt', 'ram', 'rar', 'rm', 'rmi', 'rmvb', 'rtf', 'sdc', 'sitd', 'swf', 'sxc', 'sxw', 'tar', 'tgz', 'tif', 'tiff', 'txt', 'vsd', 'wav', 'wma', 'wmv', 'xls', 'xml', 'zip') ;
$Config['DeniedExtensions']['File'] = array() ;
$Config['FileTypesPath']['File'] = $Config['UserFilesPath'] . 'file/' ;
$Config['FileTypesAbsolutePath']['File']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'file/' ;
$Config['QuickUploadPath']['File'] = $Config['UserFilesPath'] ;
$Config['QuickUploadAbsolutePath']['File']= $Config['UserFilesAbsolutePath'] ;

$Config['AllowedExtensions']['Image'] = array('bmp','gif','jpeg','jpg','png') ;
$Config['DeniedExtensions']['Image'] = array() ;
$Config['FileTypesPath']['Image'] = $Config['UserFilesPath'] . 'image/' ;
$Config['FileTypesAbsolutePath']['Image']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'image/' ;
$Config['QuickUploadPath']['Image'] = $Config['UserFilesPath'] ;
$Config['QuickUploadAbsolutePath']['Image']= $Config['UserFilesAbsolutePath'] ;

$Config['AllowedExtensions']['Flash'] = array('swf','flv') ;
$Config['DeniedExtensions']['Flash'] = array() ;
$Config['FileTypesPath']['Flash'] = $Config['UserFilesPath'] . 'flash/' ;
$Config['FileTypesAbsolutePath']['Flash']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'flash/' ;
// Do I need to change these as is suggested in the
$Config['QuickUploadPath']['Flash'] = $Config['UserFilesPath'] ;
$Config['QuickUploadAbsolutePath']['Flash']= $Config['UserFilesAbsolutePath'] ;

$Config['AllowedExtensions']['Media'] = array('aiff', 'asf', 'avi', 'bmp', 'fla', 'flv', 'gif', 'jpeg', 'jpg', 'mid', 'mov', 'mp3', 'mp4', 'mpc', 'mpeg', 'mpg', 'png', 'qt', 'ram', 'rm', 'rmi', 'rmvb', 'swf', 'tif', 'tiff', 'wav', 'wma', 'wmv') ;
$Config['DeniedExtensions']['Media'] = array() ;
$Config['FileTypesPath']['Media'] = $Config['UserFilesPath'] . 'media/' ;
$Config['FileTypesAbsolutePath']['Media']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'media/' ;
$Config['QuickUploadPath']['Media'] = $Config['UserFilesPath'] ;
$Config['QuickUploadAbsolutePath']['Media']= $Config['UserFilesAbsolutePath'] ;

I'm not sure where to enable the cookie domain name. I remember seeing a mention of that.
I don't have any goat but the neighbours have cows? Do you think that they would OK?

Greg.

FCKEditor 6.1

matkeane - April 10, 2008 - 12:00

Hi,

Yeah it's that line in the config file: $Config['Enabled'] = true ; which over-rides whatever you may have enabled in the module settings via the Drupal interface. Now that you've set that, and assuming you have enabled file uploads for the FCKEditor profile you are using and set the access permissions for the user to do this, you should be set to go...

The cookie domain is set in the Drupal site settings file, e.g. sites/www.example.com/settings.php and you should find a line - probably commented out - that looks like this:

$cookie_domain = 'example.com';

You might need to clear out the cache to make sure that your browser is using the updated JS config files - Firefox in particular likes to hang onto previous versions.

I would think a cow would leave you with some extra credit in hand, so you might want to wait until you're having some problems with taxonomy and cck, and then do a sacrifice to cover everything!

Mat

FckEditor 6.1

cloudmaker - April 12, 2008 - 22:57

cloudmaker

Dear Mat,
Thanks very much. I finally got it working. I was delayed due to my updating to 6.2 with which I had some problems. But I've learnt a lot.
I had to create a /userfiles/image directory, which I remember seeing

$Config['UserFilesPath'] = '/userfiles/' ;

but it took me a while to figure out.

Thanks again.
Greg.

FckEditor 6.1 & Drupal 6.2

matkeane - April 13, 2008 - 12:16

Hi,

Glad you got it working - I forgot about that other step in the install-voodoo dance!

Have you got the latest version of FCKeditor (6.x-1.2-1) working with Drupal 6.2? I've done the 6.2 upgrade (haven't seen any problems there), but I'm hesitant to do the FCKeditor upgrade - seeing as it's all working at the moment!

Mat

FckEditor 6.1 with Drupal 6.2

cloudmaker - April 15, 2008 - 02:37

cloudmaker

Yes I've installed Drupal 6.2 and FckEditor 6.1.2-1 works fine, well except for one thing.
When I try to upload images, it appears that they have been uploaded but I can't find them on my sever anywhere if I brows using FCK or ftp client.
I ended up uploading images manually and that works fine.
Any clues?

Additional I have problem with the Garland Theme after upgrading to 6.2.
I ran into a problem, the Garland theme and so put a virginal copy of the them in the Theme directory, which broke it even more.
After thinking about it I decided to look at the various tables via phpmyadmin.
I found that there is a Variables table where in garland had the garland files as something like sites/default/files/color/garland-91832b9d.
So I changed the name of my garland-xxx directory to reflect that and all seemed OK. But then I made some admin change and that change changed the garland-xx number and I had to change it back again. What do you think makes the change and is there any way to change it so that the change that is being made does to break my theme?

Greg.

FCKeditor losing files

matkeane - April 15, 2008 - 09:35

Hi,

Yeah, I also had that disappearing images thing at one point, but in fact the upload was working, but the image was being dropped into a different folder that FCKeditor had created at the site root ('/filesimages') as I'd messed up the Userfiles settings in the module settings. So, currently the $Config['UserFilesPath'] setting in the connector config files is commented out, and all the file paths are set through the Drupal interface - just be careful about them slashes between the path elements!

I also ran into the Garland theme problem when trying to sync the local and distant versions of a site. The only workaround I found that worked was to regenerate the color files in the theme settings page, as even symlinking the color files to eachother didn't work.

Mat

Regeneration?

cloudmaker - April 16, 2008 - 05:50

cloudmaker
How did you regenerate the color files? By adjusting the colors?

Greg.

Regeneration?

matkeane - April 17, 2008 - 10:57

Hi,

Well, I just hit 'save' in the theme color settings without modifying anything - that generated a new set of color files (identical to the previous ones) and everything worked OK. Not sure why that was necessary, but modifying the values directly in the system table (via phpMyAdmin), or trying to symlink to a previous set didn't seem to work.

[Update]

Actually, scratch that - it's all coming back to me now! I think I found that the theme would basically refuse to recognise the existing color files until I tweaked the settings to create new ones - at which point the system table was updated with the path to the new ones. Then I opened the old ones (with my correct color settings) and resaved over the new files. Not a very elegant solution, but it worked!

Mat

 
 

Drupal is a registered trademark of Dries Buytaert.