一定有很多人跟我一樣,在使用fckeditor的時候
常因為上傳資料時,因為帳號不同每個人看到的資料夾就不同。
或是管理的資料夾的時候很麻煩。

因此,在網路上找了些資料及自己修改的結果
這是管理資料夾最快的方式~~~
當然,還有其他的方式,不過,要能夠具有多元化,
最好的方法當然是修改dll啦~~~

若想自己試著修改,可以到 CKEditor 下載原碼
http://ckeditor.com/download

 

先找到 config.ascx 檔案
fckeditor\editor\filemanager\connectors\aspx\config.ascx

修改以下的程式碼
public override void SetConfig()
{
    // SECURITY: You must explicitly enable this "connector". (Set it to "true").
    Enabled = CheckAuthentication();

    // URL path to user files.
        UserFilesPath = "/userfiles/";
        string m_userName = Session["loginID"].ToString() + "/";

    // The connector tries to resolve the above UserFilesPath automatically.
    // Use the following setting it you prefer to explicitely specify the
    // absolute path. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
    // Attention: The above 'UserFilesPath' URL must point to the same directory.
    UserFilesAbsolutePath = "";

    // Due to security issues with Apache modules, it is recommended to leave the
    // following setting enabled.
    ForceSingleExtension = true;

    // Allowed Resource Types
    AllowedTypes = new string[] { "File", "Image", "Flash", "Media" };

    // For security, HTML is allowed in the first Kb of data for files having the
    // following extensions only.
    HtmlExtensions = new string[] { "html", "htm", "xml", "xsd", "txt", "js" };

    TypeConfig[ "File" ].AllowedExtensions            = new string[] { "7z", "aiff", "asf", "avi", "bmp", "csv", "doc", "fla", "flv", "gif", "gz", "gzip", "jpeg", "jpg", "mid", "mov", "mp3", "mp4", "mpc", "mpeg", "mpg", "ods", "odt", "pdf", "png", "ppt", "pxd", "qt", "ram", "rar", "rm", "rmi", "rmvb", "rtf", "sdc", "sitd", "swf", "sxc", "sxw", "tar", "tgz", "tif", "tiff", "txt", "vsd", "wav", "wma", "wmv", "xls", "xml", "zip" };
    TypeConfig[ "File" ].DeniedExtensions             = new string[] { };
    TypeConfig[ "File" ].FilesPath                    = "%UserFilesPath%" + m_userName + "file/";
    TypeConfig[ "File" ].FilesAbsolutePath            = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%file/" );
    TypeConfig[ "File" ].QuickUploadPath              = "%UserFilesPath%" + m_userName + "";
    TypeConfig[ "File" ].QuickUploadAbsolutePath      = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );

    TypeConfig[ "Image" ].AllowedExtensions           = new string[] { "bmp", "gif", "jpeg", "jpg", "png" };
    TypeConfig[ "Image" ].DeniedExtensions            = new string[] { };
    TypeConfig[ "Image" ].FilesPath                   = "%UserFilesPath%" + m_userName + "image/";
    TypeConfig[ "Image" ].FilesAbsolutePath           = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%image/" );
    TypeConfig[ "Image" ].QuickUploadPath             = "%UserFilesPath%" + m_userName + "";
    TypeConfig[ "Image" ].QuickUploadAbsolutePath     = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );

    TypeConfig[ "Flash" ].AllowedExtensions           = new string[] { "swf", "flv" };
    TypeConfig[ "Flash" ].DeniedExtensions            = new string[] { };
    TypeConfig[ "Flash" ].FilesPath                   = "%UserFilesPath%" + m_userName + "flash/";
    TypeConfig[ "Flash" ].FilesAbsolutePath           = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%flash/" );
    TypeConfig[ "Flash" ].QuickUploadPath             = "%UserFilesPath%" + m_userName + "";
    TypeConfig[ "Flash" ].QuickUploadAbsolutePath     = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );

    TypeConfig[ "Media" ].AllowedExtensions           = new string[] { "aiff", "asf", "avi", "bmp", "fla", "flv", "gif", "jpeg", "jpg", "mid", "mov", "mp3", "mp4", "mpc", "mpeg", "mpg", "png", "qt", "ram", "rm", "rmi", "rmvb", "swf", "tif", "tiff", "wav", "wma", "wmv" };
    TypeConfig[ "Media" ].DeniedExtensions            = new string[] { };
    TypeConfig[ "Media" ].FilesPath                   = "%UserFilesPath%" + m_userName + "media/";
    TypeConfig[ "Media" ].FilesAbsolutePath           = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%media/" );
    TypeConfig[ "Media" ].QuickUploadPath             = "%UserFilesPath%" + m_userName + "";
    TypeConfig[ "Media" ].QuickUploadAbsolutePath     = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );
}


arrow
arrow
    全站熱搜

    Roger 發表在 痞客邦 留言(0) 人氣()