Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
elioschmutz opened this issue Feb 20, 2020 · 0 comments
Open

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

elioschmutz opened this issue Feb 20, 2020 · 0 comments

Comments

@elioschmutz
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants