To enable the image management function of the CuteEditor control, you must set up a managed image gallery folder.
This is simply a folder in which you will be placing images for your users to
use in their content. Create a folder in your application's root folder. (For
most applications, this is your web server's root folder, or the folder where
your Visual Studio .NET project file is located.) The folder can be named
something like "/uploads/", "/images" or "/UserImages". Use "~/" (tilde) as a substitution of the web-application root directory.
Make sure that the MACHINE/ASPNET user has Read+Write permissions on this
folder and its contents.
You can easily specify the image gallery path using the following methods:
1. Edit security policy file
The security policy file (default.config, admin.config and guest.config) can be found in the /CuteEditor/Configuration/Security folder. In security policy file you can find the ImageGalleryPath element which contains the image gallery path information within CuteEditor. By default, it contains the following value:
<security
name
="ImageGalleryPath"
>~/uploads</security><!-- Image Gallery Dialog -->
<security
name
="ImageBrowserPath"
>~/uploads</security><!-- Insert Image Dialog -->
You can modify ImageGalleryPath element and ImageBrowserPath element to meet your own requirements.
For example:
Use absolute path:
<security
name
="ImageGalleryPath"
>/uploads</security><!-- Image Gallery Dialog -->
<security
name
="ImageBrowserPath"
>/uploads</security><!-- Insert Image Dialog -->
Use physical path:
<security
name="ImageGalleryPath"
>c:\inetpub\wwwroot\uploads</security><!-- Image Gallery Dialog -->
<security
name="ImageBrowserPath"
>c:\inetpub\wwwroot\uploads</security><!-- Insert Image Dialog -->
2. Programmatically specify the Image gallery path
C# Example:
//use the app-based path
Editor1.Setting["security:ImageGalleryPath"]= "~/uploads";
Editor1.Setting["security:ImageBrowserPath"]= "~/uploads";
//use the absolute path
Editor1.Setting["security:ImageGalleryPath"]= "/uploads";
Editor1.Setting["security:ImageBrowserPath"]= "/uploads";
//use the physical pathor
Editor1.Setting["security:ImageGalleryPath"]= @"c:\inetpub\wwwroot\uploads";
Editor1.Setting["security:ImageBrowserPath"]= @"c:\inetpub\wwwroot\uploads";
//use the app-based path
Editor1.SetSecurityImageGalleryPath("~/uploads");
Editor1.SetSecurityImageBrowserPath("~/uploads");
//use the absolute path
Editor1.SetSecurityImageGalleryPath("/uploads");
Editor1.SetSecurityImageBrowserPath("/uploads");
//use the physical path
Editor1.SetSecurityImageGalleryPath("c:\inetpub\wwwroot\uploads");
Editor1.SetSecurityImageBrowserPath("c:\inetpub\wwwroot\uploads");
VB Example:
//use the app-based path
Editor1.Setting("security:ImageGalleryPath")= "~/uploads"
Editor1.Setting("security:ImageBrowserPath")= "~/uploads"
//use the absolute path
Editor1.Setting("security:ImageGalleryPath")= "/uploads"
Editor1.Setting("security:ImageBrowserPath")= "/uploads"
//use the physical pathor
Editor1.Setting("security:ImageGalleryPath")= "c:\inetpub\wwwroot\uploads"
Editor1.Setting("security:ImageBrowserPath")= "c:\inetpub\wwwroot\uploads"
//use the app-based path
Editor1.SetSecurityImageGalleryPath("~/uploads")
Editor1.SetSecurityImageBrowserPath("~/uploads")
//use the absolute path
Editor1.SetSecurityImageGalleryPath("/uploads")
Editor1.SetSecurityImageBrowserPath("/uploads")
//use the physical path
Editor1.SetSecurityImageGalleryPath("c:\inetpub\wwwroot\uploads")
Editor1.SetSecurityImageBrowserPath("c:\inetpub\wwwroot\uploads")
Multiple Image gallery paths are supported, they must be separated by a vertical bar (|).
<security
name
="ImageGalleryPath"
>/uploads|/photos</security><!-- Image Gallery Dialog -->
<security
name
="ImageBrowserPath"
>/uploads|/photos</security><!-- Insert Image Dialog -->
Editor1.Setting["security:ImageGalleryPath"]= "~/uploads|/photos";
Editor1.Setting["security:ImageBrowserPath"]= "~/uploads|/photos";
Multiple folder paths are supported, they must be separated by a vertical bar (|).
<security name ="HideDirectoryList" >/folder1|/folder2</security>
Editor1.Setting["security:HideDirectoryList"]= "~/folder1|/folder2";
Multiple files are supported, they must be separated by a vertical bar (|).
<security name ="HideFileList" >/hidethisfile.jpg|^.*hidethiskeyword</security>
Editor1.Setting["security:HideFileList"]= "/hidethisfile.jpg|^.*hidethiskeyword";