https://github.com/litongjava/go-file-server
使用go语言开发的一个文件服务器
https://github.com/litongjava/go-file-server
Last synced: about 1 month ago
JSON representation
使用go语言开发的一个文件服务器
- Host: GitHub
- URL: https://github.com/litongjava/go-file-server
- Owner: litongjava
- License: apache-2.0
- Created: 2022-11-21T09:56:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-21T09:16:04.000Z (almost 3 years ago)
- Last Synced: 2025-06-02T07:38:59.331Z (about 1 year ago)
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
## go-file-server
go-file-server 是一个文件服务器,包含了上传和下载功能
## Install
```
mkdir /opt/package/go-file-server -p
cd /opt/package/go-file-server
wget https://gitee.com/ppnt/go-file-server/releases/download/v1.0/go-file-server-linux-amd64-1.0.0.zip
unzip go-file-server-linux-amd64-1.0.0.zip -d /opt/
cd /opt/go-file-server-linux-amd64-1.0.0/
```
```
mkdir config
vi config/config.yml
```
```
app:
port: 10406
filePath: /data/upload
```
```
chmod +x go-file-server
./go-file-server
```
## upload file
```
curl --location --request POST 'http://127.0.0.1:10406/file/upload' \
--form 'file=@"/root/code/project/go-file-server/readme.md"'
```
repsponse
```
2023-07-17/35a3a36d-0aa4-4de0-822f-09d50ffef056
```
Directory structure
```
/data/upload/
└── 2023-07-17
└── 35a3a36d-0aa4-4de0-822f-09d50ffef056
└── readme.md
```
## wownload file
http://127.0.0.1:10406/file/download/2023-07-17/35a3a36d-0aa4-4de0-822f-09d50ffef056