Java development: Share the image of Baidu Ueditor and seven cows integrated upload

Source: Internet
Author: User

Do the site, if the upload of a large number of pictures, now many people will choose seven Bull image server. Well, today is the question of how to upload a picture of the site with the seven-ox SDK integration.

JSP page, the implementation of the image upload a lot of ways, today to say under the Baidu Editor: Ueditor

First to go to the official website to download it, I will also attach the source code, the need for a friend can download.

We create a new project: Qndemo, and then put the ueditor in the Webroot directory, as follows:

In addition, we will introduce the JAR package:

Front page, we need to reference the relevant JS, the default configuration, will be loaded with editing effects, such as:

At this point, the images we upload will be saved locally on the server. Below, we begin to integrate seven kn.

To upload to seven cattle space, the first to have a developer account and space, login to seven cattle official website, follow the instructions, you can get account, space, key and key information.

The interface to be used in the integration is as follows:

After uploading to seven kn, you can select a space and click on content management to view the upload results:

Project, add the seven-ox SDK, after simplification, as follows:

The configuration of the Config class needs to be modified:

To modify the Uptoken class configuration:

Below, we focus on the configuration of Ueditor: Ueditor.config.js

To integrate seven KN uploads, Ueditor's JSP file processing classes are modified to:

In addition, image.html to generate tokens, the path:

Next, we can open the page to see the effect:

After confirming, look at the HTML, the effect is as follows:

Click the Start Upload button to confirm, view the HTML, the effect is as follows:

Select a picture and click Confirm to view the HTML, the effect is as follows:

Select a picture and click the Confirm button to view the HTML, the effect is as follows:

Finally, attach a full picture, the effect is as follows:

The source is uploaded to Baidu Cloud network disk, interested friends can download:

Address: Http://pan.baidu.com/s/1qWsfZrQ

Extract Password: 9mgr

Java development: Share the image of Baidu Ueditor and seven cows integrated upload

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.