0

I have different folders under CKFinder to store images of different users. I can also browser them separately without disturbing images of other users.

The problem occurs when two users have images with the same name say "1.png", then one image is shown for both users. If we have 2.png for userA and 3.png for userB then there is no problem of images mixed up.

In SetConfig function of config.ascx

string folderPhysicalPath = Server.MapPath("~/Uploads/Images/"+MySession.ClientKey);

if (!System.IO.Directory.Exists(folderPhysicalPath))
    System.IO.Directory.CreateDirectory(folderPhysicalPath);

// The base URL used to reach files in CKFinder through the browser.
BaseUrl = Convert.ToString(ConfigurationManager.AppSettings["AppPath"]) + "/Uploads/Images/"+MySession.ClientKey+"/";

// The phisical directory in the server where the file will end up. If blank, CKFinder attempts to resolve BaseUrl.
BaseDir = folderPhysicalPath;

.
.
.
.



type = ResourceType.Add("Images");
type.Url = BaseUrl + "/Images/";
type.Dir = BaseDir == "" ? "" : BaseDir + "/Images/";
type.MaxSize = 0;
type.AllowedExtensions = new string[] { "bmp", "gif", "jpeg", "jpg", "png" };
type.DeniedExtensions = new string[] { };
Kumaresan
  • 11
  • 3

1 Answers1

1

I have changed resourcetype to be dynamic instead of static "Images".

type = ResourceType.Add(MySession.ClientKey + "_Images");

This solved my problem..

Kumaresan
  • 11
  • 3