I'm sure loads of people out there are using FCKeditor happily, so this should be an easy question to answer!

What are the changes I need to make to the config.js in order to get uploads working ?

what I have done:
- Drupal 4.6.3
- I have installed latest versions of all the bits & made config changes listed in install.txt- the WYSIWYG interface works fine.
- upload module switched on (I assume this is necessary) and working properly (using 'drupal/files' folder)
- tried some of the config 'patches' from FCKeditor project issues - didn't appear to make any difference
- guessed at changes to FCKConfig.ImageUploadURL, etc url refs : I've tried:
FCKConfig.ImageUploadURL = FCKConfig.BasePath + '/drupal/modules/upload.module?Type=Image' ;
and
FCKConfig.ImageUploadURL = FCKConfig.BasePath + '/drupal/modules//fckeditor/ssip/connector.php?Type=Image' ;
I think this is the right track, but I'm not sure what to point them at!

problem, when I try to upload a an image through FCKeditor 'files on server' interface I seem to be looking at the root folder and can't get anything to appear in it. I can't see any newly created folders, or see files that it tells me have been uploaded.

I have sent support requests to FCKeditor project (no response yet) but this is surely such common knowlege ? If someone could just email me a copy of their working config.js (if that's the only file I need to config) I'm sure I could work out what I need to do.

Any and all suggestions most warmly welcomed :)

:-J

Comments

JohnG-1’s picture

sorry but surely loads of people know this one!

OK I promise to write a new install.doc for FCKeditor if I can get to understand it myself!

please!

sangamreddi’s picture

Hi,

You need to edit these files for the upload and browser functions to work.. I am not a expert i gave a try and it's working perfectly

modules\fckeditor\lib\editor\filemanager\upload\php\config.php
modules\fckeditor\lib\editor\filemanager\browser\default\connectors\php\config.php

Go through these files u'l find instruction over there

Sunny
www.gleez.com

JohnG-1’s picture

i am getting confirmation that files have been uploaded, but they are invisible on the FCKbrowser and invisible on the server! No error messages ar anything.

Here's a long list of the chages I have made so far. Perhaps some are unnecessary. i seem to have added the '/drupal/' thing to the FCKConfig.BasePath + rather a lot ... but I'm confused what the Basepath is by the install.txt for the fckeditor module...

* in drupal/
create folder 'UserFiles' set chmod to 777

*in drupal/Userfiles/
create folder 'File' set chmod to 777
create folder 'Image' set chmod to 777
create folder 'Flash' set chmod to 777
create folder 'Media' set chmod to 777

*in drupal/modules/fckeditor/ssip/properties.inc

from:
$properties['context_path'] = '';
to:
$properties['context_path'] = '/drupal';

and

from: I can't remember what this was before I changed - I think it was ????
	$properties['File']   = '/File';
	$properties['Image']  = '/Image';
	$properties['Flash']  = '/Flash';
	$properties['Media']  = '/Media';

to:

	$properties['File']   = '/UserFiles/';
	$properties['Image']  = '/UserFiles/Image';
	$properties['Flash']  = '/UserFiles/Flash';
	$properties['Media']  = '/UserFiles/Media';

* in drupal/modules/fckeditor/fckconfig.js

from: 
FCKConfig.ImageBrowser = true ;
FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/asp/connector.asp' ;
// ASP.Net		// FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/aspx/connector.aspx' ;
// ColdFusion	// FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/cfm/connector.cfm' ;
// Perl			// FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/perl/connector.cgi' ;
// PHP			// FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/php/connector.php' ;
// PHP - mcpuk	// FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/mcpuk/browser.html?Type=Image&Connector=connectors/php/connector.php' ;
FCKConfig.ImageBrowserWindowWidth  = FCKConfig.ScreenWidth * 0.7 ;	// 70% ;
FCKConfig.ImageBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ;	// 70% ;

to:

FCKConfig.ImageBrowser = true ;
FCKConfig.ImageBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Type=Image&Connector=/drupal/modules/fckeditor/ssip/connector.php" ;
// PHP // FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/php/connector.php' ;
FCKConfig.ImageBrowserWindowWidth  = FCKConfig.ScreenWidth * 0.7 ;	// 70% ;
FCKConfig.ImageBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ;	// 70% ;

( I did the same for FCKConfig.LinkBrowserURL except ...html?Type=Image&Connector... is ...html?&Connector... so it gives access UserFiles folder and subfolders.
and FCKConfig.FlashBrowserURL, except the ...html?Type=Image&Connector... is ...html?Type=Flash&Connector...)

from:

FCKConfig.ImageUpload = true ;
FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/upload/asp/upload.asp?Type=Image' ;
// PHP // FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/upload/php/upload.php?Type=Image' ;
FCKConfig.ImageUploadAllowedExtensions	= ".(jpg|gif|jpeg|png)$" ;		// empty for all
FCKConfig.ImageUploadDeniedExtensions	= "" ;							// empty for no one

to:

FCKConfig.ImageUpload = true ;
FCKConfig.ImageUploadURL = FCKConfig.BasePath + '/drupal/modules/fckeditor/lib/editor/filemanager/upload/php/upload.php?Type=Image' ;
FCKConfig.ImageUploadAllowedExtensions	= ".(jpg|gif|jpeg|png)$" ;		// empty for all
FCKConfig.ImageUploadDeniedExtensions	= "" ;							// empty for no one

( I did the same for LinkUpload and Flash Upload )

* in drupal/modules/fckeditor/lib/editor/filemanager/browser/default/connectors/php/config.php
* and in drupal/modules/fckeditor/lib/editor/filemanager/upload/php/config.php

from: 

// SECURITY: You must explicitelly enable this "connector". (Set it to "true").
$Config['Enabled'] = false ;
// Path to user files relative to the document root.
$Config['UserFilesPath'] = '/UserFiles/' ;

to:

// SECURITY: You must explicitelly enable this "connector". (Set it to "true").
$Config['Enabled'] = true ;
// Path to user files relative to the document root.
$Config['UserFilesPath'] = '/drupal/UserFiles/' ;

I think that's all!

scroogie’s picture

It worked for me. I would suggest you try a fresh start if you touched files you were not supposed to change. If your Domain directly points to drupal you just need to set

FCKConfig.LinkBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Type=Image&Connector=/modules/fckeditor/ssip/connector.php"

and

FCKConfig.ImageBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Type=Image&Connector=/modules/fckeditor/ssip/connector.php"

which you can copy/paste from the Readme.txt. If you have to go to domain.com/drupal/ then you need to insert /drupal before /modules in the above path.

Then set the path_seperator in properties.inc (/ on *nix, \ on win) and the path options on the bottom of the file. These directories are to be under the context_path set in properties.inc and do need write permissions.

However, maybe you want to have a look at the ImageManger from Wei Zhuo, you can see screenshots of it at http://scroogie.de/index.php?/archives/41-FCKEditor-ImageManager.html

JohnG-1’s picture

thanks scroogie,

did as you said, clean install of module and fckeditor files - I even tried using the older version 2.0 of FCKeditor. Minimal edits of config.js (with and without closing ; ) and properties.inc (thanks I hadn't clocked the seperator last time).

but no change in problem. I still can't get anything to save on the server through the FCKeditor interface.

So I tried the blatent 'enabled = true' settings in the editor and browser config.php scripts as per Sunny's tip (which does make alot of sense when I try to get my head round the code :?)

(no change)

Following that logic I also set the ImageUploadURL and LinkUploadURL in config.js to the php version of the filepath and gave them the full 'drupal/modules ...' path assuming that FCKConfig.BasePath is going to be the same.

(no change)

The thing is that everywhere I look, the default settings are .asp not .php. And each time I change another setting, nothing chnages - it doesn't get worse or crash or even spit out an error. It just doesn't seem to be doing what it thinks it's doing!

So thanks to both of you. You've both pointed out things that hadn't occured to me and I really apreciate your support. How can it work so easily for some people and require strange tweeks for others? It's going to be something really simple and embarassing isn't it :?

this is getting depressing :(

scroogie’s picture

The thing is, you dont have to do the changes that sangamreddi said. These are different connectors, for php, asp, a improved php version, _and_ the drupal one. The changes from sngamreddi would change the php version, which is not in use. The entries in fckconfig.js have to point to the drupal connectors (in lib/ssip/...). I suspect in your case its an error with your paths.

JohnG-1’s picture

I switch on this morning and find that it's beginning to work! uploader and browser!

I don't believe it! It must have been some cacheing problem (aswell!). I'm using Firefox and I was clearing the cache and reloading between every test, but it seems that that wasn't thorough enough ... (?) could be my first problem with Firefox. Fo testing this time I used a separate window rather than just a tab & cleared & closed the browser between edits (even more laborious!)

Anyway, using fck 2.0 the browser view upload works fine, but there's still something funny not going on when I use the upload tab in the 'image properties' window: A phantom upload when I click on 'send to server'.

When I escape // the LinkUpload and ImageUpload paths that sangamreddi pointed to, the browser continues to function so I guess Scroogie's right about those changes being unmecessary :)

However, when I tried with fck 2.1, the browser no longer shows the files in the folders (nor the folders for that matter).

What I did was keep the 2 versions of fck in seperate 'lib' folders on the server, renaming the one I was not using either lib20 or lib21. After getting 2.0 working I hand-copied the config.js settings to the 2.1 version (I might have made a mistake). The properties.inc is upstream of 'lib' so can be left alone. After switching between the lib folders a couple of times clearly 2.0 was working and 2.1 wasn't.

So unless I made a typo somewhere in my 2.1 ( and I did a quick check), I suspect that there is a compatibility problem between our fckeditor.module and the latest version (2.1) of the fckeditor package.

I'm so exhausted with this that I'm not going to try a fresh install with 2.1 to verify the bug! If someone else wants to pick up this batton ...

Big thanks to scroogie and sangamreddi for helping me through this traumatic initiation to fckeditor :)

Hmm now what was that link scroogie pointed out ? ... It does look very promising - but I looked at the patch and thought I'll wait for a more tried and tested version :) I just want a simple life!

plebe’s picture

I seem to not be able to make it work for the life of me. I'm using 2.2. The editor works, but no filemanager usability. Just a window with an XML error (404) and creating folders doesn't work.

Any idea about 2.2 anyone?

Watch the DeviantRhythms videodocumentary on-line now:
http://www.plebeian.org/deviantrhythms/

amstercad’s picture

here: drupal\modules\fckeditor\lib\editor\filemanager\upload\php

fixus971’s picture

I'm found an omission in
lib/editor/filemanager/upload/php/config.php
correct as:
// Path to uploaded files relative to the document root.
//$Config['UserFilesPath'] = '/UserFiles/';
$Config['UserFilesPath'] = '/files/' ;

Now work fine.

And how continue war with fck image browser that don't work!
I some can help me.. Thancks

fixus971’s picture

Hi, I'm happy to annunce that I'm starting to understand how to Test fckeditor on specific server to Found right setup.
All that readme don't say..
First of all go to try simple Image Browser with the page for testing:
http://www.site.it/modules/fckeditor/lib/editor/filemanager/browser/defa...
Set Connector = PHP (enabled in config.php)
and Resource Type = Image (insert exaple images via FTP)
Use comand => Get Folders and Files
If all ok you see your images
If not you get on video Path and URL tested and according with this you can retray anoter path in config.php to found right setup.
5mins for me.
And..
With same tip I'm startup new browser system that use icons for images and new comands:
http://www.site.it/modules/fckeditor/lib/editor/filemanager/browser/defa...
I get and copy file Test.html from default/connectors/test.html dir
This setup is more complex but go right.
All this tests are in textmode but now all work and I can see in:
http://www.site.it/modules/fckeditor/lib/editor/filemanager/browser/defa...
and
http://www.site.it/modules/fckeditor/lib/editor/filemanager/browser/mcpu...
This links is the same called by fckeditor dialog.

Now I'm starting to test/connecting fck with drupal.

FiX of www.fixweb.it

fixus971’s picture

Drupal is Big Big Big.

FCKeditor is the Best!
It's ok with old 56K modem too.

Thancks to all developpers.

green monkey’s picture

Fixweb,
Thanks for your post it saved me a lot of grief and time

...... and it worked!!

NEWBIES: if you don't want to edit the config.php --- you can also make a dir called /UserFiles/ in the root. It will probably need 755 or 777 - try both

webmasterk@www.cupiodissolvi.com’s picture

Hello, it took several trial and error night sessions at setting the mofo up, but eventually I got it fully working.

The module is the one I downloaded from drupal.org (4.6.x)
The fckeditor lib is the latest : 2.2

Unpack the module in an empty dir. Unpack the FCKeditor 2.2 into the lib dir of the module directory.

1) If your drupal is installed into a dir (such as /drupal or /myblog or whatever, get into the ssip dir and edit properties.inc

edit the line : $properties['context_path'] = '/drupal'; and set it to to point to the dir where your site is actually installed into, otherwise set it to blank
ex : $properties['context_path'] = '';

2) Get into lib, and edit fckconfig.js
Here we've got to tell FCKeditor that we're using PHP to handle the filebrowser (It is defaulted to ASP...WE REALLY MUST CHANGE THIS, I MEAN , OF COURSE, IF YOU USE PHP, AND MOST DO)

// The following value defines which File Browser connector and Quick Upload
// "uploader" to use. It is valid for the default implementaion and it is here
// just to make this configuration file cleaner.
// It is not possible to change this value using an external file or even
// inline when creating the editor instance. In that cases you must set the
// values of LinkBrowserURL, ImageBrowserURL and so on.
// Custom implementations should just ignore it.
var _FileBrowserLanguage = 'php' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = 'php' ; // asp | aspx | cfm | lasso | php

As you can see I've just changed to php the var_FileBrowserLanguage and var_QuickUploadLanguage.

3) Get into :
lib/editor/filemanager/browser/default/connectors/php

and edit config.php

change the line:

// SECURITY: You must explicitelly enable this "connector". (Set it to "true").
$Config['Enabled'] = false ;

to

// SECURITY: You must explicitelly enable this "connector". (Set it to "true").
$Config['Enabled'] = true ;

That's all.

Check that into your wwwroot dir (whatever it is , /drupal, /mysite etc) exist a directory named /UserFiles and that its permissions are 777 (I Know it's insecure.. though)

Upload the whole fckeditor dir onto your /modules dir, enable the fckeditor from the admin panel and give it a try.

alargent’s picture

This worked for me. Ignore the included instructions and follow this.

suydam’s picture

I've followed the instructions here, and I can actually upload images.

BUT, the browser won't show anything.

Using the connector test page linked in one of the comments above, I can pull up a list of my folders, but they don't actually show as links or icons. Rather, they're showing as XML:

This XML file does not appear to have any style information associated with it. The document tree is shown below.


<Connector command="GetFoldersAndFiles" resourceType="Image">
<CurrentFolder path="/" url="/files/Image/"/>
<Folders/>

<Files>
<File name="1.jpg" size="31"/>
<File name="aaa_cupolahome.jpg" size="48"/>
</Files>
</Connector>

Any ideas?

zom’s picture

same for me, upload ok, but path for the image into the popup is bad so there is no preview image and no image in the post.
So I conclude somewhere the path should be change.

Anyway the path in the server root when dupral is in subdirectory is not the best one Ithink , it be better to put the UserFiles in the dupral files system where all users images are generally stored.

drupal is great but including images in the post becomes a nightmare for me. I lost days to try all modules and wysig editor (tinymce etc). It's a real problem to obtain something that any forum does without any problem...
If this simple function could be integrated in dupral it would be a big progress.

webmasterk@cupiodissolvi.com’s picture

I missed to add that you've got to change the path indicator into properties.inc. It is defaulted to \\ (that is windows style).

You MUST change this to / (unix style)

see here below :

// The file system path separator (\) windows, (/) unix
$properties['path_separator'] = '/';

(you'll find this properties.inc into fckeditor/ssip )

This may be held responsible for all the strange PATH problems you are experiencing.

Regards

K.

zom’s picture

thahnks for your help, it seems to work now (exept for files with accent).

I would like the image have a default size (exemple 300 ) in the post, in the pop up is it possible to insert in the code a default value ?

summit’s picture

Hi,
Does someone has the fckeditor module with the latest FCKeditor 2.4.2 working?
If so.
Isn't it easier to file the working FCKeditor as a package.
Can somebody please do this?
I tried to solve the uploading with above remarks but after 2 nights..it is not working unfortunately.
Please help!

EDIT: I use IMCE now for the uploading. That is working great!

greetings,
Martijn

ekompute’s picture

Looks like you need to be a programmer to even install a simple WYSIWYG editor!

kayaker’s picture

Not really, but one does have to read the readme.txt and follow it to the letter. I've installed FCKEditor on both D5 and D6 and it does work.
__________________________________________________________________________________

Aweigh - not all who wander are lost.