Docs Guides

Files

Uploading, allowed types, and how learners download.

Upload with multipart/form-data, field name file.

curl -X POST "$LMS_URL/api/v1/assets" \
  -H "X-API-Key: $LMS_KEY" \
  -F "file=@handbook.pdf"

Allowed types#

PNG, JPEG, GIF, WebP, MP4, WebM, MP3, M4A, PDF, plain text, CSV, ZIP, and Word, Excel and PowerPoint documents. Anything else returns 415.

Important

SVG and HTML are refused, because they can carry script. Convert logos to PNG.

How files are stored#

  • The server generates the storage key; your filename is sanitised and kept only as a label.
  • Each file records its size and SHA-256.
  • Downloads use the stored content type, X-Content-Type-Options: nosniff and a download disposition.

Using a file#

Reference its id in a block (VIDEO, IMAGE, FILE), a course cover, or a certificate design. You can’t delete a file that is still in use (409).

Learners#

Learners download files through their enrollment (/me/enrollments/{e}/assets/{id}/content). Only files used by their course version are served.

Note

Files are stored on the server’s disk (STORAGE_DIR). Object storage such as S3 is on the roadmap.

Type to search guides and every endpoint.