Only in the /userfiles/ folder. For website systems with multi-user membership systems, this is obviously inappropriate because all users cannot share the same resource folder.
Therefore, dynamic configuration must be carried out to allow different users to upload image, Flash and other resource files to their own private folders.
FCKeditor is uploaded to directory configuration in the editor\filemanager\connectors\php\ configuration file. The core statement is:
$Config['UserFilesPath'] = ‘/userfiles/';
Just modify this statement to achieve the purpose of configuring the upload directory.
Take lightPHP, the popular CMS, as an example, its multi-user folder is in the /datas/userfiles/ folder. For example, /datas/userfiles/admin is the user directory of the user admin, and so on. So if a user logs in, the value of the $Config['UserFilesPath'] array should be equal to /datas/userfiles/[username]. This can be achieved through a session. For example, $_SESSION['current_user'] represents the current user name, then the configuration statement is:
$Config['UserFilesPath'] = ‘/datas/userfiles/' . $_SESSION['current_user'] . ‘/';
This enables dynamic configuration of uploading directories in a multi-user environment.
When implementing the specific implementation, the issue that should be noted is that to use session, the session_start(); statement must be executed first. Also, in some cases, if the session is lost, you need to pay attention to the path of the session.
In the lightPHP system, the complete configuration statement is:
session_save_path(realpath('../../../../../../datas/temp'));
session_start();
$Config['UserFilesPath'] = ‘/datas/userfiles/' . $_SESSION['current_user'] . ‘/';
For more questions, please discuss with the author himself.
This article comes from the CSDN blog. Please indicate the source when reprinting: /zhangking/archive/2009/06/24/
Therefore, dynamic configuration must be carried out to allow different users to upload image, Flash and other resource files to their own private folders.
FCKeditor is uploaded to directory configuration in the editor\filemanager\connectors\php\ configuration file. The core statement is:
$Config['UserFilesPath'] = ‘/userfiles/';
Just modify this statement to achieve the purpose of configuring the upload directory.
Take lightPHP, the popular CMS, as an example, its multi-user folder is in the /datas/userfiles/ folder. For example, /datas/userfiles/admin is the user directory of the user admin, and so on. So if a user logs in, the value of the $Config['UserFilesPath'] array should be equal to /datas/userfiles/[username]. This can be achieved through a session. For example, $_SESSION['current_user'] represents the current user name, then the configuration statement is:
Copy the codeThe code is as follows:
$Config['UserFilesPath'] = ‘/datas/userfiles/' . $_SESSION['current_user'] . ‘/';
This enables dynamic configuration of uploading directories in a multi-user environment.
When implementing the specific implementation, the issue that should be noted is that to use session, the session_start(); statement must be executed first. Also, in some cases, if the session is lost, you need to pay attention to the path of the session.
In the lightPHP system, the complete configuration statement is:
Copy the codeThe code is as follows:
session_save_path(realpath('../../../../../../datas/temp'));
session_start();
$Config['UserFilesPath'] = ‘/datas/userfiles/' . $_SESSION['current_user'] . ‘/';
For more questions, please discuss with the author himself.
This article comes from the CSDN blog. Please indicate the source when reprinting: /zhangking/archive/2009/06/24/