The file is uploaded to the server, and the front end downloads directly through http-url

Requirement description:
There is a function in the project to import user information, but the user is not clear about the format of the table/data to be imported, so here is a template for the user; please see the following picture ( download template ) for a
Insert picture description here
simple idea (for reference only! !!!):
First of all, I thought of putting the file on the tomcat server or Nginx and exposing the path to the front end for downloading. (The following describes the use of tomcat server to download files)

Implementation process:
1. First, ensure that tomcat has been installed on the server;

2. Create a folder under Tomcat's webapps, and upload the files we will download to this folder;
Insert picture description here
3. Restart Tomcat service

./shutdown.sh  #停止服务
./startup.sh  #启动服务

Insert picture description here
4. Use the browser to directly access the file to be downloaded to complete the download; (input the folder name/file name under ip:port/webapps)
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_44146379/article/details/108408390