async fn add_media(
    pool: Data<PgPool>,
    exam_id: Path<Uuid>,
    payload: Multipart,
    request: HttpRequest,
    user: AuthUser,
    file_store: Data<dyn FileStore>,
    app_conf: Data<ApplicationConfiguration>
) -> ControllerResult<Json<UploadResult>>
Expand description

POST /api/v0/cms/exams/:exam_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