A simple web server built in Go that serves file downloads via HTTP.
- HTTP file server with download endpoints
- Custom download headers for forced file download
- Cross-platform compatibility
- Simple and lightweight
- Clone the repository:
git clone https://github.com/bini-x/go-file-server.git-
Run the server: go run main.go
-
Go to http://localhost:8080 or if you want to send a file from your pc(laptop) to your mobile phone or other pcs on the same network, open your browser on the device in which you want to download the file and type "http://[ipAddress]:8080/", where [ipAddress] is the ip address of the pc in which the server is running.
-
Click the link to download the file.
If you want to download another file, add it to this folder and then change the code parts where is "example.pdf". If you also change the file format (.jpeg, .mp4...), make sure to change the "application/pdf" part to the correct content-type.