async fn add_media(
course_id: Path<Uuid>,
payload: Multipart,
request: HttpRequest,
pool: Data<PgPool>,
user: AuthUser,
file_store: Data<dyn FileStore>,
app_conf: Data<ApplicationConfiguration>,
) -> ControllerResult<Json<UploadResult>>
Expand description
POST /api/v0/cms/courses/:course_id/upload
- Uploads a media (image, audio, file) for the course from Gutenberg page edit.
Put the the contents of the media in a form and add a content type header multipart/form-data.
ยงExample
Request:
POST /api/v0/cms/pages/d86cf910-4d26-40e9-8c9c-1cc35294fdbb/upload HTTP/1.1
Content-Type: multipart/form-data
BINARY_DATA