Ckeditor says file browser disabled for security reasons. I'm using ckfinder. Can't upload anything how do I fix this? I tried pretty much everything. Removed the $cookie comment from settings.php and followed all the drupal.ckeditor.com installation directions for ckfinder.

Comments

mvonrose’s picture

subscribing

mvonrose’s picture

I think that this issue comes from the CheckAuthentication() function in filemanager.config.php. If I set the return value of CheckAuthentication in the config.php file in ckfinder to "true" and don't include the filemanager.config.php file, ckfinder shows up fine. Is there an error in the modules rewrite of CheckAuthentication()?

UPDATE:
Found the issue is with the line:
$authenticated = user_access('allow CKFinder file uploads');

This always evaluates to false unless "anonymous" is given permissions to "allow CKFinder file uploads". If this is the case it seems sort of stupid to even have the huge rewrite of CheckAuthentication() and just have CheckAuthentication() return true all of the time.

sp09’s picture

thanks for the support but I've given up on this editor along with all the other drupal editors. I always have some kind of issue with them one way or another.

-Anti-’s picture

> I always have some kind of issue with them one way or another.

I feel your pain. I can't believe it is 2010, and we're still using these kinds of editors, for which the technology hasn't changed in about ten years. It's absolutely ridiculous. I'm quite new to website building - two years - and I'm constantly amazed why everything is made so difficult and limited. html, css, javascript, php - the whole adhoc way these internet technologies have been developed is insane.

techcord’s picture

ditto here - can confirm that giving anonymous access "fixes" the problem.

ishener zaph’s picture

very good! thank you!

bclinton’s picture

I resolved this problem by putting the
require_once '../../../../includes/filemanager.config.php';
in the right spot.

In the ckfinder/config.php, the first time the $baseDir = resolveUrl($baseUrl); line is listed it is in a comment block. It can be a little confusing because despite being in a comment block, there's a comment above the line, making it seem like this line is not commented out. Mine looks like this:

/*
$baseDir : the path to the local directory (in the server) which points to the
above $baseUrl URL. This is the path used by CKFinder to handle the files in
the server. Full write permissions must be granted to this directory.

Examples:
	// You may point it to a directory directly:
	$baseDir = '/home/login/public_html/ckfinder/files/';
	$baseDir = 'C:/SiteDir/CKFinder/userfiles/';

	// Or you may let CKFinder discover the path, based on $baseUrl:
	$baseDir = resolveUrl($baseUrl);


ATTENTION: The trailing slash is required.
*/
$baseDir = resolveUrl($baseUrl);  
// ADD IT HERE, NOT ABOVE

so, make sure you add it after the second $baseDir = resolveUrl($baseUrl); because if you add it right after the first occurance it will be part of the comment.

Once I corrected my mistake here I was able to use the upload function without allowing anonymous permission to use ckfinder.

cirlot’s picture

This is exactly what i did as well. Thanks.

amirtaiar’s picture

I have the same strange behave - strange cuase I have been using CK with many website an this is the first time it's happen to me.

I didn't understand:
I resolved this problem by putting the
require_once '../../../../includes/filemanager.config.php';
in the right spot.

As for the rest, my code look just like the one you show here...

Managing Partner at Reasonat

net55’s picture

dido second
$baseDir = resolveUrl($baseUrl);
is the one, thx

ecosnow’s picture

I had to fix this by giving permissions to the anonymous user and will not work by giving the permissions to the authenticated user. I am logged in of course as the admin and that was already checked in the permissions.

Does anyone suppose this is a security issue? Considering the permissions to the user only to add articles with images.

:)

zenoni’s picture

I have the same problem with Drupal 7.12 using CKeditor 3.6.2

I get a message: "The file browser is disabled for security reasons. Please contact your system administrator and check the CKFinder configuration file."

Ho can I solve the problem? What I need to edit in config.php and filemanager.config.php to get the file upload forking?

hschott’s picture

All was working fine until I upgraded the ckeditor module and drupal 6.24. I

mattys’s picture

these frickin editors cause me no end of problems

ptocco’s picture

No sooner than I had fixed the permissions bug in CKEditor, setting Anonymous to have permission to operate CKeditor I believe it was, a new problem sprang up. If I try to Browse the Server, my first option, I'm told "Folder not Found. Refresh and Try again." If I go to Upload, Choose File, I can see my local computer, but when I select a file and click Send to Server, it stops right there.

Does anybody have a clue?

I'm coming from the Wordpress camp, in which I never had this type of module installation problem.

Thnx!

Pete

pitxels’s picture

I am kind of stubborn and didn't wanted to give permission to anonymous

So I read an old article, and just defined my $base_url and $cookie_domain in sites/default/settings.php

That did the trick for me

--
Drupal Theming at
www.pitxels.com

oregonwebsiteservices’s picture

defining $base_url and $cookie_domain fixed it for me!

Anonymous’s picture

$base_url is all I needed to set. Thanks.

govind.maloo’s picture

I am not able to understand why the hell this is happening . In all browser ckfinder file browser working properly, but when I am trying to upload a file using IE9 it sometime working or sometime behave very strange. Like upload a file working fine, next try to upload another image it just show file browser disabled due to security reason.

Anybody have any idea about this.

Thanks in advance

shaunpv’s picture

go to your congif file in ckfinder and the return in the below to true not false .... prob fixed

function CheckAuthentication()
{
	// WARNING : DO NOT simply return "true". By doing so, you are allowing
	// "anyone" to upload and list the files in your server. You must implement
	// some kind of session validation here. Even something very simple as...

	// return isset($_SESSION['IsAuthorized']) && $_SESSION['IsAuthorized'];

	// ... where $_SESSION['IsAuthorized'] is set to "true" as soon as the
	// user logs in your system. To be able to use session variables don't
	// forget to add session_start() at the top of this file.

	return true;
}
updeshhw’s picture

1. Open settings.php file

drupal_site_name/sites/default/settings.

2. Uncomment “$cookie_domain = ‘example.com’;” and give your domain name.

eg: $cookie_domain = ‘yoursite.com’;

ryanoreilly’s picture

Confirming this fixed my issue as well. Should be noted to include the dot before the domain.

$cookie_domain = ‘.yoursite.com’;
Robin Kumar Tonk’s picture

i just change in setting.php file line no 338 uncomment $cookie_domain = ‘.example.com’; and changed to $cookie_domain = ‘.testsite’;

its is wroking fine now thanks ryanoreilly

Rejneesh Raghunath’s picture

Go to your drupal site folder /sites/default
open settings.php with notepad

search for #$cookie_domain = ‘.example.com’;

enable the settings by removing # from the beginning

replace example.com with your domain Name ie: #$cookie_domain = ‘.your-domain-name.com’;

save file and replace settings.php in your server with the updated one.

now when you upload the file your server wont accept it because settings.php is write protected (0444) by default. You will need to change the file permission of settings.php in your server, right click settings.php in your server click "file permission" and enable write access to the owner. (0644)

replace settings.php from your local computer

Done!