Looking to create some file paths for the uploader/server browser dynamically depending on the area of the site which the fckeditor is being used in. For example AV would be C:\wwwroot\AV\Images... but if they were using it in the ART area C:\wwwroot\Art\Images.
I know where they are set and have it working if they are set manually. I was wondering if there was any way they could be changed dependant on the are being visited.
Anyhelp is much appreciated.
I know where they are set and have it working if they are set manually. I was wondering if there was any way they could be changed dependant on the are being visited.
Anyhelp is much appreciated.
RE: Coldfusion & Dynamic Filepaths
<cfif ListLen(cgi.script_name, '/') GT 1>
<cfset myArea = "/" & ListFirst(cgi.script_name, '/') & "/">
<cfelse>
<cfset myArea = "/">
</cfif>
<cfparam name="request.FCKEditor" default="#StructNew()#">
<cfset request.FCKEditor.userfilesPath = myArea & "userfiles/">
RE: Coldfusion & Dynamic Filepaths
Hi thanks for the quick reply...

to extrapolate a little the full path for an upload example art would be C:\Inetpub\wwwroot\final\art\.
The code you provided kind of worked, except for it just places the the files in a folder called "Image on C:\Inetpub\wwwroot\final...
I tried changing the code to read:
<cfset myArea = "C:\Inetpub\wwwroot\final\" & ListFirst(cgi.script_name, '/') & "\">
Which ran in .cfm page of the editor returns the correct path for the upload. Unfortuantly it doesnt seem to wanna place it in the right directory.
Any help is much appreciated
RE: Coldfusion & Dynamic Filepaths
<cfset myArea = "/final/">
<cfif ListLen(cgi.script_name, '/') GT 2>
<cfset myArea = myArea & ListGetAt(cgi.script_name, 2, '/') & "/">
</cfif>
<cfparam name="request.FCKEditor" default="#StructNew()#">
<cfset request.FCKEditor.userfilesPath = myArea & "userfiles/">
Right?
RE: Coldfusion & Dynamic Filepaths
even if the output of the code on a the page i'm using shows the correct upload directory. Could it be something else i'm doing wrong.