This is a creation in Article, where the information may have evolved or changed.
Golang Write service-side program, as a file upload and download server. Cooperate with HTML5 to use Web page as user page
1. Entire Engineering structure
Where: Mainup.go is listening to the local waiting for user access to upload the service-side program, Mainup.exe is the corresponding executable file.
Maindown.go is listening locally waiting for the developer to access the application to see all uploaded files and download the deleted server program.
Indexup.html is a Web page presented to the user to upload files, indexdown.html is to view all uploaded files, to delete the downloaded service-side program.
The static folder contains the referenced library
The Files folder holds uploaded documents.
2. Source code
Both the Mainup.go and Maindown.go files refer to the gin package, and I've downloaded it locally from GitHub. After downloading the source code, the user remembers setting up the download gin package.
GitHub has not been passed on, the entire project here to save the Baidu Cloud disk. The link address is as follows:
Http://pan.baidu.com/s/1jIRio4Y