Hi all,
Im running v2.5 of FCK Editor on PHP and so far it has been excellent and very simple to use and configure.
I have stumbled into some problems though regarding the user files path. I have created a custom CMS that allows different users with different access privlidges to upload images to the server, Ideally I would like some of these user types to upload images to a folder I specify for them... for example..
User1 would upload to /userfiles/user1/image/
User2 would upload to /userfiles/user2/image/
I thought I could change the default config at runtime using the following code
This seems to set the values as I want them but doesnt change where images are uploaded,
Can anyone point me in the right direction of where Im going wrong?
Thanks in advance!
Im running v2.5 of FCK Editor on PHP and so far it has been excellent and very simple to use and configure.
I have stumbled into some problems though regarding the user files path. I have created a custom CMS that allows different users with different access privlidges to upload images to the server, Ideally I would like some of these user types to upload images to a folder I specify for them... for example..
User1 would upload to /userfiles/user1/image/
User2 would upload to /userfiles/user2/image/
I thought I could change the default config at runtime using the following code
$username = 'user1'; $wysiwyg = new FCKeditor('wysiwyg'); $wysiwyg->Config['UserFilesPath'] = '/userfiles/' . $username . '/'; echo $wysiwyg->CreateHtml();
This seems to set the values as I want them but doesnt change where images are uploaded,
Can anyone point me in the right direction of where Im going wrong?
Thanks in advance!
Re: Changing upload directories at run time
I am also trying to set the upload directory but it does not seem to work at all.
FFMG
Re: Changing upload directories at run time
Cheers
Re: Changing upload directories at run time
You might want to properly configure the server connector (config.php) instead.
Re: Changing upload directories at run time
But then how can I set the upload path that way?
What is the default path anyway?
FFMG
Re: Changing upload directories at run time
Ok, I had a look and setting the value $Config['UserFilesPath'] when creating the editor doesn't really help because the uploader makes another server request to open the dialog.
It then gets the value from the config.php file.
This is why they advise you to set a session value so that in the config.php file the value will be read when the request is made.
Such a great editor, I find it difficult to understand why setting a folder at run time is so complex.
using $_SESSION is also a bit messy in some cases I think.
FFMG
Re: Changing upload directories at run time
but it doesn't take effect! $_SESSION['account_name'] is an empty value...
How this problem can be solved?
Re: Changing upload directories at run time
try use $_COOKIE ...
)
my small "trip" for upload connector (I use my config, from my site engine, for change automatical path's, because i create many sites and me need make it fast
like this:
p.s. Sorry for my English ...