Skip to content

Allow object-metadata for @tus-upload endpoint #6274

@elioschmutz

Description

@elioschmutz

Problem

The tus protocol provides a metadata header (https://tus.io/protocols/resumable-upload.html#upload-metadata) to upload metadata directly in the POST request.

Our implementation in the plone.restapi uses this header only for the portal type (@type), filename and file-content type but not for the plone object metadata like title or description.

if we create a new file, we have to perform three requests:

  1. create a tus object with POST request
  2. upload the file-data with a PATCH request
  3. update the object metadata with a second PATCH request

If there is an error between the second and the third request, we have an uncompleted state. The plone obejct with the file is created but the metadata is not updated.

Suggested solution

We should extend the @tus-upload POST endpoint with the ability to receive and use object metadata.

POST /@tus-upload HTTP/1.1
...
Upload-Metadata: @type b64str, filename b64str, content-type, b64str, metadata b64str

The metadata property contains a base64 encoded json object of object metadata which should be updated after object creation.

This issue is a follow-up issue of #6197

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions