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