Hello,
I am trying to install FCKeditor. The editor works fine, but when i want to implement the upload feature as described in the topic 'File Browser and Quick Upload' on the wikipage
http://wiki.fckeditor.net/Developer%27s_Guide/Integration/ASP.Net
I get the following exception:
Exception Details:
System.InvalidOperationException: Failed to map the path '/UserFiles/'.
I am using Visual Studio Team System 2008 Development Edition, I am coding in .NET 2.0 and using the language VB.
The folder UserFiles is created and the 2 users mentioned in the article have enough rights to write in that folder (modify rights).
De debugger of Visual Studio will launch your website in its own webserver on the location http://localhost:4190/ProjectName.
Can someone point me in the good direction to solve this problem?
Thanks in advance.
      Thu, 12/20/2007 - 19:53
                
  
    
        
    #1
  
Re: File Browser and Quick Upload problem
I added the following key to web.config
But I still found an inconsistence between the upload and the browse server.
For all clearance i clicked on the image button on the editor tool bar.
The 'Image Properties' pop-up window appears. There you can go to the tab Upload, this will upload the image to /UserFiles/
When you select the button 'Browse Server' you are browsing in the folder /UserFiles/image and you are not able to get up to /UserFiles/.
Anyone got an idea how to solve it?
Thanks in advance
Re: File Browser and Quick Upload problem
Hi again.
I found a solution regarding the Browse Server path and the upload.
I made some changes on the code as well. Since I am working with .NET (ASP.NET 2.0) these changes can be different for other languages.
1. Browse to Server will go to the /UserFiles/ instead of /UserFiles/<Type> where <Type> can be Image or Flash
Open the Source by double clicking 'FredCK.FCKeditorV2.csproj'
Open 'FileBrowserConnector.cs'
And change the following code (at line 254)
private string ServerMapFolder( string resourceType, string folderPath ) { // Get the resource type directory. //string sResourceTypePath = System.IO.Path.Combine( this.UserFilesDirectory, resourceType ) ; // <-- This line has been commented string sResourceTypePath = this.UserFilesDirectory ; // <-- This line has been added // 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('/') ) ; }Compile the code and copy the dll to your bin folder and re-reference that dll.

2. When selecting an image in the browser it will give you the wrong path
Open FCKeditor\editor\filemanager\browser\default\browser.html with notepad or something similar (notepad++
And change the following code (at line 63)
oConnector.SendCommand = function( command, params, callBackFunction ) { var sUrl = this.ConnectorUrl + 'Command=' + command ; //sUrl += '&Type=' + this.ResourceType ; // <-- This line has been commented sUrl += '&Type=' ; // <-- This line has been added sUrl += '&CurrentFolder=' + encodeURIComponent( this.CurrentFolder ) ; if ( params ) sUrl += '&' + params ; // Add a random salt to avoid getting a cached version of the command execution sUrl += '&uuid=' + new Date().getTime() ; var oXML = new FCKXml() ; if ( callBackFunction ) oXML.LoadUrl( sUrl, callBackFunction ) ; // Asynchronous load. else return oXML.LoadUrl( sUrl ) ; return null ; }Save the file and recompile your project and test it.
Intensive testing is needed. Maybe a better solution can be found, but the above is giving me the desired behavior.
Comments?