Cuteeditor User Manual (1) create a multi-user upload image folder

Source: Internet
Author: User

The cuteeditor has powerful functions and rich functions, but there are also disadvantages to the best of things.
This editor uploads images to put all the images in the upload folder under the root directory, and the editor does not automatically name the images. At this time, the images may be renamed and searched online for a long time, there are not many people to use, and the method is not found. I wrote it myself!
Under cutesoft_client \ cuteeditor \ dialogs \
Gecko_insertimage.frame.aspx
Insertimage. Frame. aspx
Selectimage. Frame. aspx
Insert 3 folders of images
Add reference to the header
<% @ Import namespace = "system. Io" %>
Find
Protected override void initoftype ()
{
FS. virtualroot = cuteeditor. editorutility. processwebpath (context, null, secset. imagegallerypath). trimend ('/') + "/";
}
Replace
Protected bool mycreatedirectory (string path)
{
Try
{
If (directory. exists (PATH ))
{
Response. Write ("the directory already exists! ");
Return true;
}
Else
{
Directoryinfo di = directory. createdirectory (PATH );
Response. Write ("directory should be created successfully! ");
Return true;
}
}
Catch
{
Response. Write ("exception! ");
Return false;
}
Finally {}
}
Protected override void initoftype ()
{

String username = request. Cookies ["hnusername"]. value;

String filename = server. mappath (secset. imagegallerypath + "/" + username );
If (mycreatedirectory (filename ))
{
FS. virtualroot = cuteeditor. editorutility. processwebpath (context, null, filename). trimend ('/') + "/";
}
Else
{
FS. virtualroot = cuteeditor. editorutility. processwebpath (context, null, secset. imagegallerypath). trimend ('/') + "/";
}
}

The three files are OK, and each user has their own folders.
The editor has two buttons for uploading images. You can only insert images and cannot upload images.
If you do not want to change a lot, you only need to hide the upload function. In this way, the previous upload button is changed to insert only images, and all images uploaded by users can be inserted.
OK

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.