MediaFileUpload media.file-upload@1

Generated at from openvibe-contracts v0.53.0 and openvibe-sdk v0.11.0.

Version
1.0.0
Owner
media
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/media/file-upload.v1.json

media.file-upload@1: the multipart/form-data body of POST /api/v1/:app/files (media.object.upload, namespace :app): one part named `file` with the bytes and its filename and type. The tenant's quota is checked against the bytes; the answer is media.file@1 (201).

Fields

FieldTypeRequiredDescriptionConstraints
filestringyesThe multipart part named file (filename and Content-Type from the part).

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: file
{
  "file": "<bytes of screenshot.png>"
}
Rejected: no-file
{
  "name": "x.png"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('media.file-upload@1', value);   // { valid, errors: [{ path, message }] }