SpringBoot2.x series of tutorials (61) Spring Boot integrates FastDFS to realize file upload

For websites with more videos, pictures or files, file upload and storage are essential.

The principle of FastDFS is introduced in the article " Detailed Explanation of the Principle of File Management System FastDFS ". Docker-based installation is introduced in the article " FastDFS is based on Docker installation, free from stepping on pits ".

This article leads you to integrate FastDFS based on Spring Boot, and implement upload and access functions.

Client

FastDFS officially provides a Java version of the client, the address is: https://github.com/happyfish100/fastdfs-client-java

However, the client has several problems: first, the naming and methods are not in accordance with the Java specifications; second, it does not support direct acquisition from the maven central warehouse, and needs to be installed locally; third, exception handling and configuration files are waiting Where to optimize.

Therefore, the individual forks a branch from this client, and then initially optimizes the above problems based on this, and then further optimizes it according to practical needs. This tutorial is also based on the first version of the optimization.

The only difference between this version and the original version is that the method name should conform to the rules of the Java specification, and other internal changes will not affect the api level.

First of all, you can directly introduce the following dependencies in the maven project:

<dependency>
    <groupId>com.github.secbr</groupId>
    <artifactId>fastdfs-client-plus</artifactId>
    <version&g

Guess you like

Origin blog.csdn.net/wo541075754/article/details/107695985