Problem: As found in kcfinder's definition I am using this link to open kcfinder:
window.open('/kcfinder/browse.php?type=files&dir=files/public&subDir=/PO/'+editId, 'kcfinder_textbox',
', width=800, height=600');
In here, I have modified the URL to also include the subdirectory path so that the URL becomes something like this http://ift.tt/1VZ7aBx .
The subDir part has the directory name to be set to (and created if not exists). In the config.php I already have a directory set to be the root. So if the subDir is provided it will create the subDir inside the root of config.php. Now I would want this subDir to be the new root directory for kcfinder.
So for example if my uploadURL in the config is /var/www/html/web/upload/ the new root for the above URL will become /var/www/html/web/upload/PO/200836/.
Attempt: So far I have been able to successfully create the directory /var/www/html/web/upload/PO/200836/ for the above URL (or any URL) provided. However, the root in kcfinder is still set to /var/www/html/web/upload/. So when I open the kcfinder, the directory gets created internally but the root is still set to the original root from config.php.
I added the following lines to change my root directory to the sub directory I pass through URL:
$this->config["uploadURL"] .= $_GET['subDir'];
$this->config["uploadDir"] .= $_GET['subDir'];
$this->typeDir = $this->config["uploadDir"] ."/files";
$this->typeURL = $this->config["uploadURL"] ."/files";
I have also raised this as an issue on github but no response from there yet. I am assuming the only change I need to do is set the root directory to display to the new directory being created but I am not sure where I am supposed to do this.
Is there a workaround for this?
PS: I am also open to any other web file manager PHP/jQuery solutions which has a way to do this. Using symfony as the framework.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire