I am using KCfinder for a project, but I am stuck at the moment.
I want a dynamic uploadDir, for example: 'uploadURL' => $_SESSION['user_upload_dir']
However, the config file of KCfinder does not accept any global variables. I read the documentation (https://kcfinder.sunhater.com/integrate#session) but I have no idea what I have to do to get it working. (English is not my main language, so it is hard for me to understand what the documentation wants me to do)
In short I want this:
- user logs in and gets a
$_SESSION['upload_key'] - user wants to upload an image, and since he is logged in, the upload directory will be changed into the upload_key: 'uploadURL' => /myuploadkey
The reason is because multiple members of the website need to have their own image folder.
All help is appreciated! :)
Sorry, strangely is was way easier than the documentation explained. All I had to do was place a
$_SESSIONinside my website with information that overrides the config.php file:Of course, I put the neccesary protection around this code so only users logged in can use the file browser.