DragXSlay
asked on
FCK Editor - Configuring PHP Image Upload
I need to be able to set a dynamic userfilespath and userfiles URL when instantiating the FCK Editor in PHP. I need to force the upload of all images, pdf's, etc. into the $client_path (in the code below). Also, when it loads the image in the preview and inserts it into the editor code, I need to force the URL it loads from as $client_url. Any help on this would be GREATLY appreciated. Thank you!
$oFCKeditor = new FCKeditor('body');
$oFCKeditor->BasePath = 'fck/';
$oFCKeditor->Width = 750;
$oFCKeditor->Height = 500;
$oFCKeditor->Value = $ed_body;
$oFCKeditor->Config['EnterMode'] = 'br';
$oFCKeditor->Config['UserFilesPath'] = $client_path;
$oFCKeditor->Create();
ASKER
Ray,
No, I'm sorry if I'm not explaining this properly. The user is going to decide what files to upload. I just want to be able to tell the editor where to store these files. As in, what folder on the drive. Basically, I'm asking how do I tell the editor which path to use and, as a result of this, which URL to use when loading the image.
No, I'm sorry if I'm not explaining this properly. The user is going to decide what files to upload. I just want to be able to tell the editor where to store these files. As in, what folder on the drive. Basically, I'm asking how do I tell the editor which path to use and, as a result of this, which URL to use when loading the image.
ASKER
The problem is, that link shows how to change thew directory via the config file. I need some way to do it while instantiating the editor itself. Something like:
$oFCKeditor->Config['UserF ilesPath'] = $client_path;
The config file will be used across all the sites I'm planning to install it on, so the file loading it is the one that has to change the appropriate directories. Any ideas?
$oFCKeditor->Config['UserF
The config file will be used across all the sites I'm planning to install it on, so the file loading it is the one that has to change the appropriate directories. Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Excellent. You can close the question by accepting your own solution as the answer, and that will PAQ it for others who come searching. Best regards, ~Ray
You can't do that, and if you find a way to do it, the www security community will be quick to shut it down. This is simply a security risk that is considered unacceptable.
Please let me know if I'm missing something. Thanks, ~Ray