Whoops.  The prior post was only half the story.  I'll start
completely over, and I'll use session vars with the idea being that
its expected you will want full control, call-by-call, over where the
editor pulls stuff from (you do the cflocking yourself):

On the template where you call fckeditor, at or near the top:

<cfset session.currentRelativePath="/woof/woof/">
<cfset session.currentSubFolder="foo">

or whatever other folder you want to use, where your path starts at
the web root.  You can NOT use an actual full path, like
c:/cfusionmx/wwwroot/woof/woof/.  You may very well want to make the
currentRelativePath var an application var set only once in
application.cfm, but that depends on your app and your needs.

here's the complete editor test template, which I put in the root
fckeditor folder.  This template will call itself, and dump out vars
to screen.  Very handy for debugging.

<cfparam name="form.FirstEditor" default="This is the first window"
type="string">
<cflock scope="session" type="EXCLUSIVE" timeout="10">
        <cfset session.currentRelativePath="/woof/woof/">
        <cfset session.currentSubFolder="foo">
</cflock>
<html><head><title>Single Editor Test</title>
</head><body>
<cfform
        action="#cgi.script_name#"
        method="POST">
<!---
here's the actual tag call.  Not much to it.
--->
<cfmodule
        template="fckeditor.cfm"
        instanceName="FirstEditor"
        toolbarSet="default"
        width="650"
        height="400"
        value="#form.FirstEditor#">
<p>
<input
        type="Submit"
        value="Submit">
</cfform>
<cfdump var="#request#" label="request">
<cfdump var="#form#" label="form">
<cfdump var="#session#" label="session">
</body></html>
--------------------------------------------------------------------------------------
Next, in config.cfm change the cfscript block at top to look like this:
<cfscript>
config = structNew();
// SECURITY: You must explicitly enable this "connector". (Set enabled
to "true")
config.enabled = true;
config.userFilesPath = session.currentRelativePath;
config.serverPath = "";
// use this to force the server path if FCKeditor is not running
directly off the root of the application or the FCKeditor directory in
the URL is a virtual directory or a symbolic link / junction
config.allowedExtensions = structNew();
config.deniedExtensions = structNew();
/*
config.allowedExtensions["File"] = "doc,rtf,pdf,ppt,pps,xls,csv,vnd,zip";
config.deniedExtensions["File"] =
"php,asp,aspx,ascx,jsp,cfm,cfc,pl,bat,exe,com,dll,vbs,js,reg";
config.allowedExtensions["Image"] = "png,gif,jpg,jpeg,bmp";
config.deniedExtensions["Image"] = "";
config.allowedExtensions["Flash"] = "swf,fla";
config.deniedExtensions["Flash"] = "";
config.allowedExtensions["Media"] =
"swf,fla,jpg,gif,jpeg,png,avi,mpg,mpeg,mp3,mp4,m4a,wma,wmv,wav,mid,midi,rmi,rm,ram,rmvb,mov,qt";
config.deniedExtensions["Media"] = "";
*/
config.allowedExtensions="doc,rtf,pdf,ppt,pps,xls,csv,vnd,zip,txt,png,gif,jpg,jpeg,bmp,swf,fla,";
config.deniedExtensions="php,asp,aspx,ascx,jsp,cfm,cfc,pl,bat,exe,com,dll,vbs,js,reg";
</cfscript>
--------------------------------------------------------------------------------------
basically what I am doing is removing the file extensions that vary by
media type and putting in a single set, as I do not want different
subfolders separating my media types.  The above are my own file
choices.  YMMV.

Next, in connector.cfm, change the cfparam for url.type to a cfset.

<cflock scope="session" type="READONLY" timeout="10">
<cfset url.type=session.currentSubFolder>
</cflock>

Now change lines 31 and 32 in connector.cfm from this

lAllowedExtensions = config.allowedExtensions[url.type];
lDeniedExtensions = config.deniedExtensions[url.type];

to this:

lAllowedExtensions = config.allowedExtensions;// [url.type]
lDeniedExtensions = config.deniedExtensions; // [url.type]

finally in fckconfig.js set

FCKConfig.LinkUpload = false ;
FCKConfig.ImageUpload = false ;
FCKConfig.FlashUpload = false ;

which will disable the upload buttons in the dialogs.  Your users can
upload by clicking the 'browse server' button, which will give them
the browser dialog where they can upload.

The benefit to all this is 1)you have bypassed the FCKEditor's imposed
file structure heirarchy, which says you can only have one upload
folder, and uploads for images must go to a folder named /images/, for
example and 2)your users get a single consistent interface for
uploads, whether they are sending up files, images or Flash objects.

--
--mattRobertson--
Janitor, MSB Web Systems
mysecretbase.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:224577
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to