This is a fileserver written in golang. As of now, this fileserver will not provide encryption or any other security measures besides logon authentication (if ran with -pass & -user flags configured) - this is just a simple fileserver. The script itself was (kinda but not really) inspired by UniIsland/SimpleHTTPServerWithUpload.py a well know python SimpleHTTPServer 'config' - however my fileserver actually works out of the box because its not from 2012 using deprecated python libraries.
As it stands, this fileserver doesn't support multiple file uploads - you can only upload one file at a time so trying to upload an array of files using curl -X POST http://IP:80 -F "upload[]=@/Users/test/a.exe" -F "upload[]=@/Users/boschko/b.dll" -H "Content-Type: multipart/form-data"
... Moreover, this is simply not the intent / use case of this script.
For those of you who are new to go and just want to run this ~ you only have to run go get github.com/gin-gonic/gin
once.
Running: go get github.com/gin-gonic/gin && go run filserver.go
Building: go get github.com/gin-gonic/gin && go build -ldflags "-w -s" filserver.go
Or build
First run: go get github.com/gin-gonic/gin
- env GOOS=windows GOARCH=386 go build -v filserver.go
- env GOOS=linux GOARCH=amd64 go build -v filserver.go
Or Makefile
Run: Make
will build for all OS compatibilities
Parameter | Description |
---|---|
-h, --help | show help message and exit |
-dir (string) | file dir (default "./") |
-pass (string) | password |
-port (string) | http port (default "80") |
-user (string) | username |