I attempted to find a way to do this using javascript, but found no reasonable way. So instead I modified the ConnectorServlet.java to inspect the request object for information on where to save the file. E.g.,
I use the same solution that bburnett71 but I have a little problem under IE. I lost my php session in the filemanager popup but not with Firefox. Did somebody already have this problem ?
for me the issue is using the same jscript code in multiple applications and for each application a different upload path.
Solved it temporarely by introducing a parameter 'configfile' which replaces '../fckconfig.js' (in which is the upload location) in fckstartup.js for an application specific location for the fckconfig file.
One nifty thing that I'm not sure if people even know exist or what but that KEWL feature of being able to specify an custom config with each instance? That solves it in the JS end, and I rather like using some type of php/whatnot for the REALLY dynamical type stuff. Tied witha DB it ALL ROCKS!!! There are apparently ways of passing JS stuff to CF, so maype the other langs have similar stuff, and we can get all the configs in one file or whatever.
Great Project FredCK et al!!!
"I got JasperReports to work with CF, no wankery!" -me (thinking java is pretty kewl... jell, techROX!)
You may also like to check out my PHP solution to this, may give you some ideas. Check out the beta version from http://www.mcpuk.net/fbxp the most interesting files will be test.php in the FCKeditor folder, common.js in editor/filemanager/browser/default/js and frmResourceList.html in editor/filemanager/browser/default and look for ExtraParams
RE: changing the fileupload folder dynamically?
thx
RE: changing the fileupload folder dynamically?
session_start();
$pagepath = isset($_SESSION["somevariable"]) ? $_SESSION["somevariable"] : "";
$config['UserFilesPath']="/uploads/".$pagepath;
$fullpath = "/home/user/public_html".$config['UserFilesPath'];
//Make sure that path exists, create it if it doesn't
if (is_dir($fullpath)==false){
$old_umask = umask(0);
mkdir($fullpath, 0777);
mkdir($fullpath."/File", 0777);
mkdir($fullpath."/Flash", 0777);
mkdir($fullpath."/Image", 0777);
mkdir($fullpath."/Media", 0777);
umask($old_umask);
}
You should be able to do something very similar with ASP.
RE: changing the fileupload folder dynamicall
String currentSiteStr=request.getParameter("CurrentSite");
String currentPath=baseDir+currentSiteStr+ "/" + typeStr+currentFolderStr
String currentDirPath=getServletContext().getRealPath(currentPath);
RE: changing the fileupload folder dynamically?
I use the same solution that bburnett71 but I have a little problem under IE. I lost my php session in the filemanager popup but not with Firefox. Did somebody already have this problem ?
Thank you.
RE: changing the fileupload folder dynamically?
Solved it temporarely by introducing a parameter 'configfile' which replaces '../fckconfig.js' (in which is the upload location) in fckstartup.js for an application specific location for the fckconfig file.
Anybody has a better idea of implementing this?
RE: changing the fileupload folder dynamicall
Great Project FredCK et al!!!
"I got JasperReports to work with CF, no wankery!"
-me (thinking java is pretty kewl... jell, techROX!)
RE: changing the fileupload folder dynamically?
if you trie to use the custom config like this:
<input type="hidden" id="dummy___Config" value="LinkBrowserURL=/fck/editor/filemanager/browser/default/browser.html?type=image&Connector=/my_app/connector.aspx">
a problem occurs that the url-string is cut of at the first '=': LinkBrowserURL=/fck/editor/filemanager/browser/default/browser.html?type
anybody got an idea for fixing this?
i tried to replace = for || and & for $$, but that's not nice cause it interferes with the core code.
RE: changing the fileupload folder dynamicall
RE: changing the fileupload folder dynamically?
my browsers can not locate:
/fck/editor/filemanager/browser/default/browser.html?Type%26Image%3DConnector%26/my_app/fck/connector.cfm
i got it working changing the file /diolog/js/fck_image.js line 249
var oWindow = window.open( oEditor.FCKConfig.ImageBrowserURL + "&Connector=" + oEditor.FCKConfig.ConnectorPath, "FCKBrowseWindow", sOptions ) ;
by introducing another parameter in fckconfig containing my custom connectorpath
RE: changing the fileupload folder dynamicall
= -> %3D
& -> %26
RE: changing the fileupload folder dynamicall
You may also like to check out my PHP solution to this, may give you some ideas. Check out the beta version from http://www.mcpuk.net/fbxp the most interesting files will be test.php in the FCKeditor folder, common.js in editor/filemanager/browser/default/js and frmResourceList.html in editor/filemanager/browser/default and look for ExtraParams