JavaScript-how pictures in Rich Text editor are saved to the server!

Source: Internet
Author: User
Keywords Php javascript html html5

The content of Rich text editor is saved to the database, the picture is reflected in the database as the address of the picture, after the saving, how to write the business logic?

Reply content:

The content of Rich text editor is saved to the database, the picture is reflected in the database as the address of the picture, after the saving, how to write the business logic?

Many editors are first to upload pictures and then return to the image address, upload the image directly on the editor configuration file modification on it, no need to write any logic

This is the editor of Baidu, it has a tutorial in the documentation

After clicking Save, it is equivalent to submitting a form, such as the Baidu editor generated as follows:

That in the backend with $_POST['content'] receive, is the text editor to submit the content.

Baidu Editor is able to upload pictures, choose to insert a picture when there is a way to send the picture to the background, back to the background after saving the path, and then you can use this path to insert the picture into the content, specific please see the document, I do not remember

Wangeditor Editor, uploading code is simple.

    1. Front-end configuration of the address of a server

editor.config.uploadImgUrl = '/upload';

    1. Background receive save data

    2. Background response out the URL of the image, you can.

This is the document http://www.kancloud.cn/wangfupeng/wanged ...

  • 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.