In my page a have the following code:
<?php id=$_GET['id']; if (!is_dir("/files/$id/")) if ( !@mkdir("/files/$id", 0777, true) ) die ('Cannot create a folder'); $finder = new CKFinder() ; $finder->BasePath = '/ckfinder/' ; $finder->StartupPath = "Files:/files/$id/" ; $finder->StartupFolderExpanded = true; $finder->SelectFunction = 'ShowFileInfo' ; $finder->Width = '100%' ; $finder->Create() ; ?>
All seems like in manual http://docs.cksource.com/CKFinder_2.x/D ... ion/PHP_V1
Script makes /files and /files/$id too, CKFinder — /files/ subdirectories, but doesn't change folder at startup. Actually, /files/$id is not available through CKFinder.
I also tried to make CKFinder use a directory outside DocRoot for some purposes, but CKFinder totally ignores any aliases i set in apache’s vhost config. When i set
Alias /files /var/srv/domain.com/fileupload
(directory exist, owned by apache and has 777 permissions) CKFinder creates a directory named ‘files’ in the DocRoot instead of using already prepared and available via alias.
Thanks in advance.
Re: CKFinder doesn't want to use StartupPath from the config
It looks to me that StartupPath might be wrong. You have set it to: "Files:/files/$id/"
Such a startup path would work, if you had the following folder structure (in Folders pane in CKFinder):
Is it possible that your folder structure looks more like:
and the "files" folder on the server actually points to the "Files" resource type?
If the answer is yes, then the startup path should be set to: "Files:/$id/"
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+