Skip to content

Fileserver written in Go with a useful upload feature that can be leveraged to transfer file between machines. Has the option to force authentication before accessing.

Notifications You must be signed in to change notification settings

OlivierLaflamme/Upload-Go-Fileserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Go fileserver with uploads

Build CC COMMIT

About

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.

Getting Started

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

Usage

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

Example

Start the go fileserver with authentication:

image

Login with credentials

image

Upload file from remote machine or download from local machine

image

View the file on fileserver

image

Resources

About

Fileserver written in Go with a useful upload feature that can be leveraged to transfer file between machines. Has the option to force authentication before accessing.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published