0

I have installed CKEditor and CKFinder in the directory like root->NEWS->ckeditor &

root->NEWS->ckfinder but I want use ckeditor & ckfinder on this file

root->NEWS->International->AddNews.aspx

So problem here is how to load filebrowser using exact base path.

ex. In code behind AddNews.aspx.cs

CKFinder.FileBrowser ckf = new FileBrowser();         
ckf.BasePath = "ckfinder/"; /*default for root installation of ckeditor & ckfinder*/
ckf.SetupCKEditor(DetailsView1.FindControl("CKEditorControl1"));

What I am getting:

http://localhost:40407/NEWS/International/ckfinder/ckfinder.html?type=Images&CKEditor=ContentPlaceHolder1_DetailsView1_CKEditorControl1&CKEditorFuncNum=2&langCode=en

But It should be:

http://localhost:40407/NEWS/ckfinder/ckfinder.html?type=Images&CKEditor=ContentPlaceHolder1_DetailsView1_CKEditorControl1&CKEditorFuncNum=2&langCode=en

Please help me. What would be the exact BasePath for this?

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
userKG
  • 79
  • 3
  • 8

1 Answers1

0

If ckfinder/ is supposed to be a root directory, use either

ckf.BasePath = "/ckfinder/";

or

ckf.BasePath = Server.MapPath("~/ckfinder");

Your path, as you've shown it, is relative from the page in which you use it. ~ is interpreted by the ASP.NET runtime as the site's virtual root, which will be resolved by MapPath to the actual root directory's path.

Tieson T.
  • 20,774
  • 6
  • 77
  • 92