Baidu editor UEditor changed to support physical path, Editor ueditor

Source: Internet
Author: User

Baidu editor UEditor changed to support physical path, Editor ueditor

I. Preface

I have been working for 2 years. There was no background development in just one year. Recently, I want to write a new project that uses the Rich Text Editor and select Baidu UEditor. It seems a little bad during use. Then, manually modify the source code. If the source code is not well written, please forgive me. This is only for beginners to learn. The technical content is not high. Please do not spray.

Ii. UEditor project structure

Iii. Transformation ideas

The uploaded image is processed through the backend. Here we find the controller. ashx file. After opening, we can see

Here, you can determine what to upload and load the configuration file (config. json ). Finally, the action. Process () method is called.

Here we find the key UploadHandler. Process () method for uploading.

Then, we found the code to convert the virtual path to the physical path.

Now we have a rough idea about the overall upload code operation.

4. Start Transformation

Start with config. json.

Add imageLocalPrefix to the configuration file and add the value

Find controller. ashx

Add this code to load the configuration file. Of course, you must add the LocalPrefix attribute to the UploadConfig object class.

Finally, the above path is changed.

Determine whether the physical path is used.

Now the transformation is complete. Our UEditor supports the upload of physical paths.

 

Related Article

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.