使用CKEditor的KCFinder - 设置上传文件的动态文件夹 [英] KCFinder with CKEditor - setting up dynamic folders for upload files

查看:1306
本文介绍了使用CKEditor的KCFinder - 设置上传文件的动态文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用CKEditor与KCFinder - 我想有一个基于动态值的个人上传文件。



我想动态地更改文件夹用户可以在登录后根据SESSION值进行上传。

一旦登录,我想限制用户可以通过KCFinder插件访问的文件夹
所以例如..

pre $ 用户abc他们的路径是abc / images
用户foo他们的路径是foo / images
用户abc无法看到foo的图像&反之亦然


解决方案

我有同样的问题,更糟糕的是它取决于谁登录,管理员或标准成员。

当然,我把它集成到TinyMCE中,但我认为原理是相同的。
$ b

以下是我对该问题的解决方案:

我的文件夹结构是

 / my_uploads / media 

/ my_uploads / media / member_folder




  1. 在config.php文件的顶部初始化php会话

    session_start()


  2. 编辑'types'=>数组并注释掉所有不同的'类型' // CKEditor& FCKEditor类型
    //'文件'=> ,
    //'flash'=> swf,
    //'images'=> * img,

    // TinyMCE类型
    //'文件'=> ,
    //'media'=> swf flv avi mpg mpeg qt mov wmv asf rm,
    //'image'=> * img,


  3. 将下面的'type'添加到数组


    $ b

    $ _ SESSION ['fold_type'] =>* img swf flv avi mpg mpeg qt mov wmv asf rm,

  4. 保存您的config.php文件

  5. 打开您的应用程序页面,初始化您的编辑器并调用KCFinder

  6. b
  7. 在初始化你的编辑器之前,添加下面几行声明各种KCFinder变量

      $ _ SESSION ['KCFINDER '] = array(); 
    $ _SESSION ['KCFINDER'] ['disabled'] = false; //激活上传器,
    $ _SESSION ['KCFINDER'] ['uploadURL'] =/ uploads;
    $ _SESSION ['fold_type'] =media;




  $ _SESSION ['KCFINDER'] = array(); 
$ _SESSION ['KCFINDER'] ['disabled'] = false; //激活上传器,
$ _SESSION ['KCFINDER'] ['uploadURL'] =/ my_uploads / media / Members;
$ _SESSION ['fold_type'] =member_account_number_pulled_from_secure_session_variable;

7离开您呼叫上传者这一行;

  file:'../tiny_mce/plugins/kcfinder/browse.php?opener=tinymce',

为KCFinder


I am using CKEditor with KCFinder - i'd like to have personal upload files based on a dynamic value.

I'd like to dynamically change the folder that users can upload based on a SESSION value once they are logged in.

Once logged in i'd like to restrict the folder that a user can access via the KCFinder plugin So eg..

User abc their path would be abc/images
User foo their path would be foo/images
User abc cannot see foo's images & vice-versa

解决方案

I had the same issue and to make things worse it depends on who logged in, administrator or a standard member.

Granted I integrated it into TinyMCE but I think the principles are the same

Here is my solution to the problem

My folder structure is

/my_uploads/media

/my_uploads/media/member_folder

  1. Initialise the php session at the top of the config.php file

    session_start()

  2. Edit the 'types' => array and comment out all the different 'types'

    // CKEditor & FCKEditor types
    // 'files'   =>  "",
    // 'flash'   =>  "swf",
    // 'images'  =>  "*img",
    
    // TinyMCE types
    // 'files'    =>  "",
    // 'media'   =>  "swf flv avi mpg mpeg qt mov wmv asf rm",
     // 'image'   =>  "*img",
    

  3. Add the following 'type' to the array

    $_SESSION['fold_type'] => "*img swf flv avi mpg mpeg qt mov wmv asf rm",

  4. Save your config.php file

  5. Open your application page where you initialise your editor and call KCFinder

  6. Before initialising your editor, add the following lines declaring the various KCFinder variables

    $_SESSION['KCFINDER'] = array();
    $_SESSION['KCFINDER']['disabled'] = false; // Activate the uploader,
    $_SESSION['KCFINDER']['uploadURL'] = "/uploads"; 
    $_SESSION['fold_type'] = "media"; 
    

or

    $_SESSION['KCFINDER'] = array();
    $_SESSION['KCFINDER']['disabled'] = false; // Activate the uploader,
    $_SESSION['KCFINDER']['uploadURL'] = "/my_uploads/media/Members";
    $_SESSION['fold_type'] = "member_account_number_pulled_from_secure_session_variable";

7 Leave the line where you call the uploader like this;

   file: '../tiny_mce/plugins/kcfinder/browse.php?opener=tinymce',

Set upload folder dynamically for KCFinder

这篇关于使用CKEditor的KCFinder - 设置上传文件的动态文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆