问题
i am working with the roxyfileman for tiny MCE, i integrated the Roxyfileman with the tinyMCE successfully and it is working fine,
But based on the users i want to list the directory in the File Manager list. But i am lagging of how to assign the value in conf.json for FILES_ROOT dynamically for the respective user
For example:
--Uploads/userupload/{userid}-{username} {userid}-{username} is a folder generated dynamically
I need to assign this path in the FILES_ROOT in Fileman
{
"FILES_ROOT": "/uploads/userupload/",
"RETURN_URL_PREFIX": "",
"SESSION_PATH_KEY": "",
"THUMBS_VIEW_WIDTH": "140",
"THUMBS_VIEW_HEIGHT": "120",
"PREVIEW_THUMB_WIDTH": "100",
"PREVIEW_THUMB_HEIGHT":"100",
"MAX_IMAGE_WIDTH": "1000",
"MAX_IMAGE_HEIGHT": "1000",
"INTEGRATION": "tinymce4",
"DIRLIST": "php/dirtree.php",
"CREATEDIR": "php/createdir.php",
"DELETEDIR": "php/deletedir.php",
"MOVEDIR": "php/movedir.php",
"COPYDIR": "php/copydir.php",
"RENAMEDIR": "php/renamedir.php",
"FILESLIST": "php/fileslist.php",
"UPLOAD": "php/upload.php",
"DOWNLOAD": "php/download.php",
"DOWNLOADDIR": "php/downloaddir.php",
"DELETEFILE": "php/deletefile.php",
"MOVEFILE": "php/movefile.php",
"COPYFILE": "php/copyfile.php",
"RENAMEFILE": "php/renamefile.php",
"GENERATETHUMB": "php/thumb.php",
"DEFAULTVIEW": "list",
"FORBIDDEN_UPLOADS": "zip js jsp jsb mhtml mht xhtml xht php phtml php3 php4 php5 phps shtml jhtml pl sh py cgi exe application gadget hta cpl msc jar vb jse ws wsf wsc wsh ps1 ps2 psc1 psc2 msh msh1 msh2 inf reg scf msp scr dll msi vbs bat com pif cmd vxd cpl htpasswd htaccess",
"ALLOWED_UPLOADS": "",
"FILEPERMISSIONS": "0644",
"DIRPERMISSIONS": "0755",
"LANG": "auto",
"DATEFORMAT": "dd/MM/yyyy HH:mm",
"OPEN_LAST_DIR": "yes"
}
回答1:
You have do define a Session Var first. For Example you write this in your config File:
"SESSION_PATH_KEY": "myRoxySession"
Now you have to Setup your Code to write into this Session Var the right path before you start Roxy File Manager. In PHP for Example:
$_SESSION["myRoxySession"] = "Uploads/userupload/{userid}-{username} {userid}-{username}"
This should work.
回答2:
First open fileman directory conf.json
sample config
"FILES_ROOT": "", // empty "SESSION_PATH_KEY": "dynamic-user-folder" // $_session["dynamic-user-folder"]
Save close config file. Now open php file add code,
if (session_status() == PHP_SESSION_NONE) { session_start(); }; $firma_slug = "/alpc-bilgisayar-aladag-n1qux"; // sample user dynamic folder name $_SESSION["dynamic-user-folder"] = "/firma".$firma_slug;
sample folder name firma
, /
char root directory
result :
root/firma/alpc-bilgisayar-aladag-n1qux // upload directory
.
Thanks user3265427
来源:https://stackoverflow.com/questions/27657889/php-roxyfileman-set-files-root-path-dynamically