Minimal HTTP server to store and retrieve files from a folder. Compiled for Linux AMD64, but you can re-compile to any Go supported architecture.
- sharing files via HTTP
- storing files for long term (like artifact repository)
Run storage and expose all files in /home/user/files
to localhost:8223
:
./storage --path="/home/user/files" --port=8223
To keep server up you should run it with some process manager, for example, supervisor.
Then, you are able to upload file file.tar.gz
via HTTP post using curl:
curl -X POST http://localhost:8223/newFolder -F [email protected]
Multiple file uploads are supported too:
curl -X POST http://localhost:8223 -F [email protected] -F [email protected]
Uploaded files should be available at http://localhost:8223/{optionalFolder}/{fileName}
curl -X DELETE http://localhost:8223/{fileName}
There are no limits who can create and delete files, to secure this server, use proxy with access authentication and specific firewall rules to avoid unwanted traffic.
- Files with same name are overwritten without any warnings
- HTTPS is not supported without additional proxy
- It is not possible to mass delete files, only one by one or whole directory
Usage of ./storage:
-debug
Enable debug output
-max int
Max uploaded file size in bytes (default 65536)
-path string
Storage path for files (default "/tmp")
-port int
Port for connecting to application (default 8222)