Uploads a binary file to the server and returns a json object with the file id, name, and url
The route handles the HTTP POST multipart request made to the '/uploads' path.
The server needs to receive a binary file via the multipart/form-data request. As with all multipart MIME types, the request body should contain:
- the Content-Disposition header that should be set to form-data
- the name attribute with the upload value
- filename - the original file name of the uploaded file
- the Content-Type header - the type of the file data content
Only one file can be sent per request.
Content-Disposition: form-data; name="upload"; filename="myImage.png"
The route returns a json object with the file id, name, and url.
The isCover property indicates whether an image is a cover image (true) or not (false).
The HTTP status code shows whether the request succeeds (response.status == 200) or fails (response.status == 500).
Related articles: Working with server