There have been plenty of really helpful posts about how to set the uploads directory at the application level.
It's a hack, I know but...
I have FCK in the web root of an intranet with a number of authoring apps accessing it. By necessity FCK needed to write files to the production environment.
Because I couldn't get the application.userFiles variation to work, I started by setting the path in a cookie ~ cookie.userFilesPath ~ that way regardless of which app invoked the editor, the cf connector would look for the cookie.
I needed to have the images written to (and read from) the production environment which did not reside in the same root as FCK. This killed it.
So, I added another cookie (yep, it's getting ugly) that set the physical path.
The altered connector.cfm code looks like this:
** comment out the if else code that sets sUserFilesURL
<!--- Read the URL --->
<cfset sUserFilesURL = cookie.userFilesURL>
<!--- Read the directory path --->
<cfset sUserFilesPath = cookie.userfilesPath>
Alter the <cfscript> that extracts the server directory to the following:
<cfscript>
// Check the current folder syntax (must begin and start with a slash).
if( compare( left( URL.CurrentFolder, 1), "/" ) )
URL.CurrentFolder = "/" & URL.CurrentFolder;
if( compare( right( URL.CurrentFolder, 1), "/" ) )
URL.CurrentFolder = URL.CurrentFolder & "/";
/**
* Prepare the XML Header and Footer
*/
sXMLHeader = sXMLHeader & '<CurrentFolder path="#URL.CurrentFolder#" url="#sUserFilesURL##URL.Type##URL.CurrentFolder#" />';
sXMLFooter = '</Connector>';
sXMLContent = '';
</cfscript>
Since we're setting both the URL and Directory paths ahead of time we don't need to worry about any of it.
Of course now the burden is on the developer to make sure that the paths are syntactically correct....
If anyone else has gotten this to work across multiple file directories, I'd love to hear how.
It's a hack, I know but...
I have FCK in the web root of an intranet with a number of authoring apps accessing it. By necessity FCK needed to write files to the production environment.
Because I couldn't get the application.userFiles variation to work, I started by setting the path in a cookie ~ cookie.userFilesPath ~ that way regardless of which app invoked the editor, the cf connector would look for the cookie.
I needed to have the images written to (and read from) the production environment which did not reside in the same root as FCK. This killed it.
So, I added another cookie (yep, it's getting ugly) that set the physical path.
The altered connector.cfm code looks like this:
** comment out the if else code that sets sUserFilesURL
<!--- Read the URL --->
<cfset sUserFilesURL = cookie.userFilesURL>
<!--- Read the directory path --->
<cfset sUserFilesPath = cookie.userfilesPath>
Alter the <cfscript> that extracts the server directory to the following:
<cfscript>
// Check the current folder syntax (must begin and start with a slash).
if( compare( left( URL.CurrentFolder, 1), "/" ) )
URL.CurrentFolder = "/" & URL.CurrentFolder;
if( compare( right( URL.CurrentFolder, 1), "/" ) )
URL.CurrentFolder = URL.CurrentFolder & "/";
/**
* Prepare the XML Header and Footer
*/
sXMLHeader = '<?xml version="1.0" encoding="utf-8" ?><Connector command="#URL.Command#" resourceType="#URL.Type#">';
sXMLHeader = sXMLHeader & '<CurrentFolder path="#URL.CurrentFolder#" url="#sUserFilesURL##URL.Type##URL.CurrentFolder#" />';
sXMLFooter = '</Connector>';
sXMLContent = '';
</cfscript>
Since we're setting both the URL and Directory paths ahead of time we don't need to worry about any of it.
Of course now the burden is on the developer to make sure that the paths are syntactically correct....
If anyone else has gotten this to work across multiple file directories, I'd love to hear how.