A simple file upload/host service with built in image optimization.
- Very low system requirements.
- Automatic image optimization to webp.
- Copy
.env.example
to.env
- Edit the
.env
file- Replace
UPLOADS_DIR
(orHOST_UPLOADS_DIR
if you are going to use docker) with the path you want the uploaded paths to be stored at. - (If you are using in production in an actual VPS) Replace
HOST
with the URL of the website.
- Replace
$ docker-compose up
Make sure following dependencies are fulfilled:
- A proper Golang configuration
libwebp
$ go mod download
$ go build -o ./out/spupload .
$ ./out/spupload
Considering the server is hosted at http://localhost:5433
, following endpoints are available:
POST http://localhost:5433/<folder_name>/<sub_folder_name>/...
Form Data:
file = File to upload (Required)
filename = Name of the file to upload as (Optional)
replace = "true" or "false" (Optional) (By default if we are uploading a file named `foo` and we already have a file named `foo`, the new file will be named `foo-1`. Setting this true will discard this feature and the file will be replaced)
disable-file-optimization = "true" or "false" (Optional) (Disable any file optimization, example: Image conversion to webp)
GET http://localhost:5433/<folder_name>/<sub_folder_name>/.../<file_name>
Query params:
view = "detail" (Optional) (Get details about the file: Filename, Size, Modification Time, Filetype)
GPLv3. See COPYING.