Hi,
First thing first I’m using FCKEditor in asp.net site on GoDaddy.com. Of course I’m using dll assembly to control editor
Now, the problem:
When I try to browse for file I always get Security Exception in procedure
Public Shared Function CreateDirectory(ByVal path As String) As DirectoryInfo
Afther several days spent in searhing solution on google, I changed entire component to vb.net and found problem and solution on my on.
Problem was in procedure _mkdir and, I quess, dllimport function “msvcrt.dll”. Probably godaddy doesn’t allow access to this function so when I change entire CreateDirectory procedure with this
Public Shared Function CreateDirectory(ByVal path As String) As DirectoryInfo IO.Directory.CreateDirectory(path) Exit Sub
everything works fine.
My question is „Why fckeditor use dllimport instead of .Net build-In function for creating folders? “ Is there some function that now doesn’t work?
Thanks
Re: Securety exception on browse
Re: Security exception on browse
Thank for your post: it keept me from trouble while deploying a .net site that uses the FCK editor at godaddy.com. Nevertheless, I feel your original post lacked detailed steps to achieve its proposed solution. Therefore, I'd post the steps I followed to solve this issue. The main tasks involded to solve this issue are:
- Edit the source code of the FCKEditor .NET dll
- Recompile the FCKEditor .NET dll
- Refresh the FCKEditor .NET dll in the project that is giving problems
To accomplish these tasks the following is required:
- Access to the source code of the FCKEditor .NETdll (In my case C#)
- Means to compile .NET assemblies (In my case Visual Studio 2005 and Visual Studio 2003)
At the time of this writing the current version of the .NET source files for the FCKEditor is 2.2. Open the Project file FredCK.FCKeditorV2.csproj with VS 2003 (If a security message appears, simply disregard it). Open the file Util.cs and comment out or delete lines 30 and 31; that is :
Next comment out or delete from lines 54 to 78 inclusive, that is:
Then Insert the following line of code right after the above code and just before the return statement of the function:
In my case the new Util.cs file looks like this:
Save changes to the file and then rebuild the solution. You will then find a new dll in the bin directory of the FCKEditor application. Depending on the mode the FCKEditor solution was rebuilt on the new dll will either be found in the bin's Release or the Debug directory. Grab that dll and replace the previous version that was being used in the problematic project. A simple cut and paste should do the trick
.
IMPORTANT: the custom CreateDirectory function is there to counter attack on a known issue with the System.IO.Directory.CreateDirectory function. Therefore, this solution might have secondary effects.
Hope this info saves someone some time and effort.
Cheers and happy programming,