{
// Required
owner_id: Fqid;
file: string; // base64 encoded
filename: string;
title: string;
// Optional
parent_id: Id;
access_group_ids: (group/meeting_mediafile_access_group_ids)[]; // only for meeting-wide mediafiles
token: string, // only for organization-wide mediafiles
}The given owner_id determines whether a meeting-wide or an organization-wide mediafile is uploaded. See Mediafiles for more details.
The parent_id, if given, must be a directory (flag mediafile/is_directory) and belong to the same owner_id. The combination of title and parent_id must be unique (a file with one title can only exist once in a directory). access_group_ids can only be given for meeting-wide mediafiles and must then belong to the meeting given in owner_id. token can only be given for organization-wide mediafiles and must be unique across all of them.
Additional fields to set:
is_directorymust be set tofalse.create_timestampmust be set to the current timestamp.mimetypeis guessed by thefilenamefilecontent(since 4.0.16)pdf_information: If the mimetype isaplication/pdfthis object needs to be filled:It is tried to get the amount of pages from the pdf. If it is encrypted or the extraction fails{ pages: number; encrypted: boolean; }
pageswill be set to 0 andentryptedto true.filesize: Size of the file in bytes.inherited_access_group_idsandis_publicmust be calculated in case of a meeting-wide mediafile or a published orga-level parent (for those meetings where the parent has meeting_mediafiles).
The file is not stored into the datastore but uploaded to the mediaservice.
The request user needs mediafile.can_manage for meeting-wide mediafiles or the OML can_manage_organization for organization-wide mediafiles.