I have looked all day for an answer to this. Lots of people skirting the issue but not answering the question.
I want a different path for the upload image for each user, i.e. the path should be $Config['UserFilesPath'] = "/$userdir/Image/";
I am using PHP. How do I put it in either fckconfig.js or /connectors/php/config.php.
I have tried passing it into /connectors/php/config.php via $HTTP_SYSTEM_VARS["userdir"] but that does not seem to work. Must be another session by then.
Don't just say use $GLOBALS....., treat me like a newbie and "show me the code".
thanks in advance.
Mon, 06/06/2005 - 07:25
#1
RE: FCKeditor RC3 dynamic upload path
I think that you should manage session manually.. using an extra parameter in every Connector request, so the editor can send session id... then, from the conector, load session vars using that Id..
Hernux
RE: FCKeditor RC3 dynamic upload path
I do not know enough javascript to take the variable into the javascript and pass it on to the php connector.
I would just like someone to clearly show me the code to pass the php path containing the original value of $userdir through to the php connector so I can have a different storage directory for each user.
Seems like an obvious request to make and something everyone would like to do. Why is it so hard?
RE: FCKeditor RC3 dynamic upload path
I am creating a CMS (in php) for diffurents users. Each user have his own folder for images. To let the editor know the image folder of the use x, I use cookies.
1/ In a page before the one that start the editor, I create a cookie that contain the name of the website of the user.
These lines msut be the first of your page(before <head>..., whatever it won't work.
2/ In the file config.php, I take the site_name from the cookie.
$user_web_site=$_COOKIE['var_name'];
and then,
config['UserFilesPath']="sites/$user_web_site";
Don't forget to creater the folder before, for exemple if an user get a website called "demo", create a folder "demo" in the folder "sites".
Personnaly, for each user :
sites/$user_web_site/Image
Good Luck
RE: FCKeditor RC3 dynamic upload path
$GLOBALS["UserFilesPath"] = $myUserFilePathFromSession ;
$GLOBALS["UserFilesDirectory"] = $myUserFilePathFromSession;
That works for me on OS-X Netscape.
RE: FCKeditor RC3 dynamic upload path
I think the reason is that there are secuirty issues in setting the upload path dynamically. Read this post for more info. https://sourceforge.net/forum/forum.php ... _id=379487
I think in previous versions you could set the ServerPath by going
FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/mcpuk/browser.html?Type=Image&Connector=connectors/php/connector.php&ServerPath=/my/dynamic/path' ;
If you are using php you can set IMageBrowserURL in your php file just like you set width or height.
If you need to set the path dynamically then you need to do some things that may compromise your security.
One way I found to do this was by passing the server path with the Type variable. eg
FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/mcpuk/browser.html?Type=Image_/New/dynamic/path&Connector=connectors/php/connector.php' ;
I did this because the Type variable is passed to the php code that actually creates folders and uploads the files.
Therefore you now need to go into these files and use preg_match() to split these variables up.
If you need more info on how this is done I can post it here.