I am using aspx. I could not get the editor to build dynamically at all. I did get. The editor to work if I put the control on the aspx page. The issue I am having now is the image browser. is I add a key in the appsetting in the web.config, it works fine see the appsetting below. I took the FCKeditor:UserFilesPath key out and I am trying to add it in dynamically like:
//***** This does NOT work!!!!!!
protected void Page_Init(object sender, System.EventArgs e)
{
Session["FCKeditor:UserFilesPath"] = ="/test1/UserFiles/";
}
<appSettings>
<!--FCKeditor's path -->
<add key="FCKeditor:BasePath" value="~/FCKeditor/"/>
<!--User Files path -->
<add key="FCKeditor:UserFilesPath" value="/test1/UserFiles/"/>
<add key="fckBrowser" value="FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/aspx/connector.aspx"/>
</appSettings>
//***** This does NOT work!!!!!!
protected void Page_Init(object sender, System.EventArgs e)
{
Session["FCKeditor:UserFilesPath"] = ="/test1/UserFiles/";
}
<appSettings>
<!--FCKeditor's path -->
<add key="FCKeditor:BasePath" value="~/FCKeditor/"/>
<!--User Files path -->
<add key="FCKeditor:UserFilesPath" value="/test1/UserFiles/"/>
<add key="fckBrowser" value="FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/aspx/connector.aspx"/>
</appSettings>

Re: UserFilesPath issue
I put this in the global.asx
void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
Session["FCKeditor:UserFilesPath"] = "/UserFiles/Image/";
}
But then you have to mess with the filebrowserconnector.cs file because it throws the resourceType on top of your path
private string GetUrlFromPath( string resourceType, string folderPath )
{
if ( resourceType == null || resourceType.Length == 0 )
return this.UserFilesPath.TrimEnd('/') + folderPath ;
else
return this.UserFilesPath + resourceType + folderPath ;
}
Re: UserFilesPath issue
Application["FCKeditor:UserFilesPath"] = TextBox1.Text;
The dll will read this
The only problem is if there are multiple users..... Back to square 1
Re: UserFilesPath issue
HELP!!!!!!
Re: UserFilesPath issue
Its work with Application variable, with an app key but not with Session.
And for the moment I think that it's impossible to configure diffrents path for the differrents FCKEdito on a page...
Re: UserFilesPath issue
First of all, I use a key in my web.config...
<add key="fckBrowser" value="FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=../../connectors/aspx/connector.aspx&ServerPath=/IISVirtualDir/UserFiles/Image/"/>
notice the ServerPath
In the "FileWorkerBase.cs" page I had to swith the code so it read the query string first.
// Try to get from the URL.
if (sUserFilesPath == null || sUserFilesPath.Length == 0)
{
sUserFilesPath = Request.QueryString["ServerPath"];
}
// Otherwise use the default value.
if ( sUserFilesPath == null || sUserFilesPath.Length == 0 )
sUserFilesPath = DEFAULT_USER_FILES_PATH ;
Then in the aspx page I add the control.
<FCKeditorV2:fckeditor id="FCKeditor1" runat="server"></FCKeditorV2:fckeditor>
Then in the Page_Init...
FCKeditor1.ImageBrowserURL = Request.Url.Scheme + "://" + Request.Url.Authority + Request.ApplicationPath.TrimEnd('/') + '/' + System.Configuration.ConfigurationManager.AppSettings.Get("fckBrowser") + Session["ID"];
Notice the session at the end. That is the id of the person logged in. There has to be a folder in the =/IISVirtualDir/UserFiles/Image/2
2 being the id and folder name
Now in the "FileBrowserConnector.cs"
I had to do this because it is adding "image" after the link. This will be a problem if you are uploading a nother type of file and want to seperate the different types of files in different folders. I have not gotten that far yet.
private string ServerMapFolder( string resourceType, string folderPath )
{
// Get the resource type directory.
// ****************HAD TO COMMENT THAT OUT
//string sResourceTypePath = System.IO.Path.Combine( this.UserFilesDirectory, resourceType ) ;
string sResourceTypePath = this.UserFilesDirectory;
// Ensure that the directory exists.
Util.CreateDirectory( sResourceTypePath ) ;
// Return the resource type directory combined with the required path.
return System.IO.Path.Combine( sResourceTypePath, folderPath.TrimStart('/') ) ;
}
Re: UserFilesPath issue
So it's not a solution for my application....
Re: UserFilesPath issue
http://aspnet.4guysfromrolla.com/articles/083105-1.aspx
Re: UserFilesPath issue
Thank you
Re: UserFilesPath issue
You have to add the following line in browser.html at line 70
sUrl += '&Digest=' + GetUrlParam( 'Digest' )
They rerwite the URL in this file