PACKAGES / MULTIPART

Split large packages

Multipart separates a large embedded payload into adjacent files without losing the manifest, graph, or SHA-256 verification of the logical content.

When to use it

Use it when the course contains a large payload—for example a video, a SCORM ZIP, or a binary—and you don't want that content to travel inside the single outer file .p2lrn.

BEFORE course.p2lrn manifest + graph + payload grande
→
AFTER course-split.p2lrn manifest + graph + descriptor curso-split.part001 curso-split.part002 curso-split.part003

Basic command

Part of an already valid package. The command creates a new package with the Multipart descriptor and writes the parts next to the output file.

Terminal
p2lrn-multipart   course.p2lrn   course-split.p2lrn   --part-size 26214400
Default size25 MiB · 26214400 bytes
Minimum allowed1 MiB · 1048576 bytes
Automatic selectionthe largest embedded representation that exceeds the limit
Explicit selection--representation <representation-id>

What changes inside the package

The representation stops pointing directly to the large payload and starts pointing to a descriptor multipart/*.json. The multipart profile is declared as required.

Descriptor conceptual
{
  "version": "1",
  "mediaType": "video/mp4",
  "size": 1503238553,
  "byteDigest": "sha256:…",
  "parts": [
    {
      "href": "course-split.part001",
      "size": 26214400,
      "byteDigest": "sha256:…"
    },
    {
      "href": "course-split.part002",
      "size": 26214400,
      "byteDigest": "sha256:…"
    }
  ]
}

How the Player rebuilds it

  1. 1. Descriptor.The Player opens the multipart descriptor of the outer package.
  2. 2. Resolution.Each href is resolved relative to the URL of the .p2lrn.
  3. 3. Verification.Each .partNNN It is validated with its SHA-256.
  4. 4. Reconstruction.The parts are concatenated in the declared order.
  5. 5. Digest final.The SHA-256 of the entire logical payload is verified.
  6. 6. Renderer.Only then is it handed over to the normal renderer.

Publishing correctly

The outer file and all parts must be accessible in the same relative path.

https://content.example.com/courses/course/
/courses/course/
├─ course-split.p2lrn
├─ course-split.part001
├─ course-split.part002
├─ course-split.part003
└─ course-split.part004
Do not move the parts separately

The href they are relative to the outer package. If a part is missing or changed, the verification fails.

SCORM and other subpackages

When an activity uses a view package-member, For example index.html inside a SCORM ZIP, multipart preserves the member name. The Player first rebuilds the logical ZIP and then opens the requested internal member.

Multiple large payloads

The command transforms a representation per execution. If you need to choose a specific one, use --representation. If you repeat the process on a package that already contains multipart, keep the previously generated and new parts in the same directory.

Terminal
p2lrn-multipart course.p2lrn course-stage1.p2lrn   --representation urn:uuid:main-video   --part-size 26214400

p2lrn-multipart course-stage1.p2lrn course-final.p2lrn   --representation urn:uuid:large-scorm   --part-size 26214400

For many large resources, consider also representing some as authorized remote resources instead of turning the entire course into a huge set of fragments.

Check before publishing

Validate the resulting package and keep all the generated parts together before uploading it to the server.

Terminal
p2lrn-validate course-final.p2lrn
p2lrn-inspect course-final.p2lrn
  • OUTERThe outer package is valid.
  • PARTSAll parts exist on the same public route.
  • HASHNo part has changed after being generated.
  • PLAYERThe Player can reconstruct the payload and render it.

Multipart Example

The included example splits a test resource into several parts and allows you to open the resulting package in the viewer to check its reconstruction.

/examples/multipart-demo/
course.p2lrn\ncourse.part001\ncourse.part002\ncourse.part003\ncourse.part004\nmetadata.json

Do you need help with this point?

The complete form is centralized so as not to repeat it in each technical article.

Contact