Uploading pictures to Image server using Ueditor (ii)

Source: Internet
Author: User

The previous article mainly wrote the front-end section How to configure the Ueditor upload path, already JSP page how to use the Ueditor editor function and how to configure a separate image upload function.

This one, I divided into two parts: the first part is to set up a picture server and configure the FTP upload function; the second part of the Ueditor Java part of the main function code, mainly FTP upload part of the code. (These codes are in the Baidu Web address of my previous website)

Part I: Setting up image server and configuring FTP upload function

Main reference: Https://www.cnblogs.com/qq3111901846/p/6505943.html, speaking very detailed, I completely follow this article step by step configuration.

1, need Linux environment, download nginx,ftp.

2, set ftpuser,ftp of the default directory/home/ftpuser, you can use this directory in Nginx as the image server's default location. When you visit a picture like this: the domain name/a.jpg, where the a.jpg is stored in/home/ftpuser.

Part Two: The main function Code of Java part of Ueditor

In fact, the main three classes,

(1) Defaultfilemanager is a locally uploaded class. Ftpfilemanager is a class that is uploaded to FTP based on Defaultfilemanger. Reference: Https://www.cnblogs.com/AlexLiu1986/p/4699764.html. Refer to the overall idea of this blog post.

This is the Ftpfilemanger code, and the difference between the local upload is to save to local, and then call the tool ftpclientutils upload to the FTP server, and then delete the local file.

(2) Ftpclientutils is a tool class for FTP. Reference time: http://blog.csdn.net/w410589502/article/details/52174123. Refer to the Ftpclientutils class for this article. Other useless.

The code is relatively simple, want to refer to a friend to see my last blog. There are links to Baidu network disk. These are I learn from the open source Web site, so it should be felt that their development, should be shared in the community, to give you a reference.

If you have any questions, you can ask me. I understand is not very good, but must sparing liker.

Uploading pictures to Image server using Ueditor (ii)

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.