/go-fileHttp

Lightweight file sharing system/轻量级GO-HTTP文件共享服务

LANGUAGE

English 中文

Describe

Lightweight file sharing system

demo photo

Install

[for linux]
git clone https://github.com/wanggaolin/go-fileHttp.git && cd go-fileHttp && ./file_http
[for mac]
wget https://github.com/wanggaolin/go-fileHttp/archive/refs/tags/mac-v1.3.tar.gz
tar -xvf mac-v1.3.tar.gz
cd go-fileHttp-mac-v1.3   
./file_http

default config

Key Value Describe
ROOT_DIR $HOME File Management Directory
ERROR_LOG error.log error log
ACCESS_LOG access.log access log
LISTEN 127.0.0.1:9191 listen addres
PUSH true enable file uploading
SHOW_ALL false show hidden files
POSH_BACKUP false upload the backup file

required parameter

Header Value Describe
Content-Type application/json
application/text
application/html
Defining return types

use/example

Get list of files:
curl -H "Content-Type:application/json" http://127.0.0.1:9090/
curl -H "Content-Type:application/text" http://127.0.0.1:9090/
curl -H "Content-Type:application/html" http://127.0.0.1:9090/
Download file:
wget http://127.0.0.1:9090/test.log
curl http://127.0.0.1:9090/test.log --output test.log
Upload file:
curl -X POST -F "file=@jquery-3.6.0.min.js" http://127.0.0.1:9090/test/test.log