{{define "api-file-post"}}
POST/file

Description

Upload a file.

Parameters

Param Required Maximum Size Default Description
file true 5 000 000 000 Bytes none Multipart file to upload
name false 255 Characters Multipart file name Name of the file to upload

Returns

HTTP 200: OK
{
	"success": true,
	"id": "abc123" // ID of the newly uploaded file
}
HTTP 422: Unprocessable Entity
{
	"success": false,
	"value": "no_file",
	"message": "The file does not exist or is empty."
}
HTTP 500: Internal Server Error
{
	"success": false,
	"value": "internal",
	"message": "An internal server error occurred."
}
HTTP 413: Payload Too Large
{
	"success": false,
	"value": "file_too_large",
	"message": "The file you tried to upload is too large. Max 5000 MB allowed."
}
HTTP 500: Internal Server Error
{
	"success": false,
	"value": "writing",
	"message": "Something went wrong while writing the file to disk, the server may be out of storage space."
}
HTTP 413: Payload Too Large
{
	"success": false,
	"value": "name_too_long",
	"message": "File Name is too long, Max 255 characters allowed."
}
{{end}}