pub async fn put(
state: State<&'static AppState>,
filename: Path<String>,
__arg2: WithRejection<TypedHeader<ContentType>, UploadError>,
__arg3: WithRejection<TypedHeader<ContentLength>, UploadError>,
headers: HeaderMap,
body: Body,
) -> Result<impl IntoResponse, UploadError>
Expand description
Create an upload
§Request
PUT /api/v1/upload/:filename
NOTE: The first URL will use the randomized upload ID as the filename.
§Headers
-
Content-Type
(required) – mimetype – the mime type (file format) of the file. Note that it will be ignored if the file is plaintext. -
Bobashare-Expiry
(optional) – number – duration until the upload should expire- specify
0
for no expiry - examples (see
str_to_duration
for more information):1d
– 1 day1h
– 1 hour1m
– 1 minute1s
– 1 second
- specify
-
Bobashare-Delete-Key
(optional) – string – custom key to use for deleting the file later; if not provided, one will be randomly generated
§Body
Should contain the contents of the file to upload
§Response
§Success
- 201 Created
Location
header containing the URL of the upload- JSON body created from
UploadResponse