PHP uses Baidu rich text editor UEDITOR to upload video and audio

  1. code structure

  • js reference

  • html rich text location

  • js code block

The info here is the content object sent back from the backend, info.content is the rich text saved in the database, used to render in the rich text editor, and toolbars is the collection of controls in the header of the rich text. fullscreen is a full-screen function button, source is a button for viewing source code, and insertvideo is a button for inserting video and audio. music is the button of network audio (this is basically useless, because we usually upload locally), ue is the editor object. editorConfig is a configuration object, which can be modified by referring to ueditor.config.js.

ue.getContent() is the final result of rich text, which is passed to the server and stored in the database

  1. code interpretation

  • ueditor.config.js

The controller address of the server here can be modified and processed by yourself.

  • uploadHandler.php

There are two parameters here from php.ini, upload_max_filesize and post_max_size, we change these two parameters to 1000M, so that the upload file limit can be changed to 1G

  1. The next most important thing is to go to the official website to download ueditor

  1. For details, please refer to the official website http://fex.baidu.com/ueditor/

Guess you like

Origin blog.csdn.net/weixin_36667844/article/details/128799909