Hi, I have been experiencing problems with session.
I am a successful listing for Files and folders. i can successful upload, rename files and create directory. but seesion out of the rename or delete directory.
Please help in this matter is. Sorry for my bad english .
I am a successful listing for Files and folders. i can successful upload, rename files and create directory. but seesion out of the rename or delete directory.
Please help in this matter is. Sorry for my bad english .
<%@ Control Language="VB" EnableViewState="false" AutoEventWireup="false" Inherits="CKFinder.Settings.ConfigFile" %> <%@ Import Namespace="CKFinder.Settings" %> <script runat="server"> Public Overloads Overrides Function CheckAuthentication() As Boolean If Session("ok") = "ok" Then Return True else Return False End If End Function '* ' * All configuration settings must be defined here. ' Public Overloads Overrides Sub SetConfig() ' Paste your license name and key here. If left blank, CKFinder will ' be fully functional, in Demo Mode. LicenseName = "" LicenseKey = "" ' The base URL used to reach files in CKFinder through the browser. BaseUrl = "/files/" ' The phisical directory in the server where the file will end up. If ' blank, CKFinder attempts to resolve BaseUrl. 'BaseDir = "/files/ BaseDir = "D:\Web-wwwroot\files\" ' Thumbnail settings. ' "Url" is used to reach the thumbnails with the browser, while "Dir" ' points to the physical location of the thumbnail files in the server. Thumbnails.Url = BaseUrl & "_thumbs/" Thumbnails.Dir = "" Thumbnails.Enabled = True Thumbnails.MaxWidth = 100 Thumbnails.MaxHeight = 100 Thumbnails.Quality = 80 ' Set the maximum size of uploaded images. If an uploaded image is ' larger, it gets scaled down proportionally. Set to 0 to disable this ' feature. Images.MaxWidth = 1600 Images.MaxHeight = 1200 Images.Quality = 80 ' Indicates that the file size (MaxSize) for images must be checked only ' after scaling them. Otherwise, it is checked right after uploading. CheckSizeAfterScaling = True ' Due to security issues with Apache modules, it is recommended to leave the ' following setting enabled. It can be safely disabled on IIS. ForceSingleExtension = True ' For security, HTML is allowed in the first Kb of data for files having the ' following extensions only. HtmlExtensions = New String() {"html", "htm", "xml", "js"} ' Folders to not display in CKFinder, no matter their location. No ' paths are accepted, only the folder name. ' The * and ? wildcards are accepted. HideFolders = New String() {".svn", "CVS"} ' Files to not display in CKFinder, no matter their location. No ' paths are accepted, only the file name, including extension. ' The * and ? wildcards are accepted. HideFiles = New String() {".*"} ' Perform additional checks for image files. SecureImageUploads = True ' The session variable name that CKFinder must use to retrieve the ' "role" of the current user. The "role" is optional and can be used ' in the "AccessControl" settings (bellow in this file). RoleSessionVar = "CKFinder_UserRole" Session("CKFinder_UserRole") = "Admin" ' ACL (Access Control) settings. Used to restrict access or features ' to specific folders. ' Several "AccessControl.Add()" calls can be made, which return a ' single ACL setting object to be configured. All properties settings ' are optional in that object. ' Subfolders inherit their default settings from their parents' definitions. ' ' - The "Role" property accepts the special "*" value, which means ' "everybody". ' - The "ResourceType" attribute accepts the special value "*", which ' means "all resource types". Dim acl As AccessControl = AccessControl.Add() acl.Role = "Admin" acl.ResourceType = "*" acl.Folder = "/" acl.FolderView = True acl.FolderCreate = True acl.FolderRename = True acl.FolderDelete = True acl.FileView = True acl.FileUpload = True acl.FileRename = True acl.FileDelete = True ' Resource Type settings. ' A resource type is nothing more than a way to group files under ' different paths, each one having different configuration settings. ' Each resource type name must be unique. ' When loading CKFinder, the "type" querystring parameter can be used ' to display a specific type only. If "type" is omitted in the URL, ' the "DefaultResourceTypes" settings is used (may contain the ' resource type names separated by a comma). If left empty, all types ' are loaded. DefaultResourceTypes = "" Dim type As ResourceType type = ResourceType.Add("Files") type.Url = BaseUrl & "Files\" type.Dir = BaseDir &"Files\" type.MaxSize = 0 type.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", "zip"} type.DeniedExtensions = New String() {} type = ResourceType.Add("Picture") type.Url = BaseUrl & "Picture\" type.Dir = BaseDir & "Picture\" type.MaxSize = 0 type.AllowedExtensions = New String() {"bmp", "gif", "jpeg", "jpg", "png"} type.DeniedExtensions = New String() {} type = ResourceType.Add("Flash") type.Url = BaseUrl & "Flash\" type.Dir = BaseDir & "Flash\" type.MaxSize = 0 type.AllowedExtensions = New String() {"swf", "flv"} type.DeniedExtensions = New String() {} End Sub </script>
Re: session problem of the changing the name folder or delete
Does it always happen?
Re: session problem of the changing the name folder or delete
Using CKFinder Version 1.4.1.1 (licensed purchased) as a stand-alone control in an ASP.NET aspx page, framework 3.5.
In my \ckfinder\config.ascx file, within the "public override void SetConfig()" method, I have one folder type "Photos" created for each user:
type = ResourceType.Add("Photos");
type.Url = MemberImagePath;
type.Dir = "";
type.MaxSize = 0;
type.AllowedExtensions = new string[] { "gif", "jpeg", "jpg", "png" };
type.DeniedExtensions = new string[] { };
The "MemberImagePath" property returns "/images/members/{0}/", where the string format placeholder {0} is the UserID value in Session. I can upload photos, delete photos, just like the OP described. I can also create a subfolder under "Photos" without issue. However, when I delete the subfolder (right-click the subfolder name, select "Delete"), the initial user's Session is lost after the delete and I receive the following message when an attempt is made to upload additional files:
"The file browser is disabled for security reasons. Please contact your system administrator and check the CKFinder configuration file."
I placed a breakpoint in my \ckfinder\config.ascx SetConfig() method and when analyzing the Session object after a sub-folder delete, the "IsNew" Session property is true and my logged-in user session info is gone. This behavior occurs regardless of whether the subfolder contains files. Note: the Session object is valid during the delete folder request:
RawUrl "/iast.com/ckfinder/core/connector/aspx/connector.aspx?command=DeleteFolder&type=Photos¤tFolder=%2Ftest%2F&hash=39bc6aeab52329e5&langCode=en"
...during this request, the Session object is still valid. It's any subsequent request that the Session is lost, as in merely clicking on the root "Photos" folder:
RawUrl "/iast.com/ckfinder/core/connector/aspx/connector.aspx?command=GetFiles&type=Photos¤tFolder=%2F&hash=39bc6aeab52329e5&showThumbs=1&langCode=en"
...no images are displayed in the right-pane and it is during this request that the Session.IsNew = true. So it seems to be losing session state after the delete folder request has completed.
If you need any additional information, please let me know. Thanks for your time.
Todd
Re: session problem of the changing the name folder or delete
This issue is caused by FCN (File Change Notifications) in Asp.Net - see this blog post: http://blogs.msdn.com/toddca/archive/20 ... 99144.aspx
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+