PLIP (Plone Improvement Proposal)
Abstract
This PLIP has three aims (and could be separated if desired)
- Implement TUS in volto for "contents > upload" with a UI similar to quanta design (inc progress bars)
- pick a js tus client to use in core
- brings parity with classic
- a UI that gives feedback on progress when files are large (even without TUS)
- bring UI closer to Quanta roadmap
- Implement TUS uploads when editing files, ie TUS support for any dexterrity content type with file fields and for images/videos fields in blocks
- otherwise its hard to explain that large uploads can only be done via content > uploads
- Simplify new file object creation UI by replacing "Add > File" with "Add > Upload files" (as per quanta design)
- because File objects are not an obvious way to add files
- Add a mode for TUS via restapi that doesn't require a shared temp folder so we can have single implementation and UI that requires less maintenance. (@davisagli suggestion)
Context
- Classic had only support for TUS in the contents file upload. This seems to be currently broken?
Motivation
- As an installer I can enable optional TUS support to enable large uploads and choose chunk size and temp folder to suit deployment but UX for the editors mostly the same
- As an editor it should be obvious and quick to bulk upload files
- As an editor, if the connection is slow or intermittent I should have clear indications upload is working, and options to resume if upload was not successful and this should apply to all places in the UI I can upload a file including editing a file object or in blocks.
- As Ops, I can enable POST size limits and still allow larger uploads.
Assumptions
- TUS requires more complex installation so will be turned off unless installer knows what they are doing
Folder contents > upload is a currently “hidden feature”
Add > File is too many clicks for most people and it’s not obvious the title is optional
Proposal & Implementation
TUS for contents upload
- enabled by env variables
- frontend TUS support will be enabled with TUS_CHUNK_SIZE and TUS_TMP_FILE_DIR environment variable
- otherwise file will be sent as a whole and TUS "create with upload" api call since there is no guarantee the tmp dir will be the same between requests.
- propose to use tus-js-client and semantic UI.
- code will be borrowed for two existing attempts. Both branches replace the only contents upload page
- using Uploady - Pretagov
- Unreleased
- uses semantic UI progress bars
- minified 50kb? TODO: actual bundle size change
- latest version incompatible with volto
- MIT License
- Uppy - Carlos de la Guardia, Franco
TUS for file fields/blocks
- no current branch but rough plan
- would likely do upload when save button clicked
- preserve transactional integrity and less likely to leave partial files around
- OR - upload as soon as file is picked but don’t do the final step to move into a blob until save
- need to check if this is possible. - pass in the uid of the upload and have the backend do the final step.
- cancel will need to remove temp files
- pro:
- big upload can finish while user fills out rest of form.
- con:
- more likely to be abandoned temp files so more clean up?
- validation won't happen until save so large files files or "bad" files could be uploaded to tmp.
Replace Add > File
- Replace "Add > File” with “Add > Upload files” and the get bulk upload page
- Any special file based content type e.g. Video, would still appear in Add menu
- but could have control panel option to hide them?
- Upload files would create content types based on file extensions and contenttype, so won’t always be “File” content type.

UI for "upload files"
TUS without temp folder
- use ZODB blobs to store partial uploads and then join them at the end
- This will have the tradeoff of using double the space until packing occurs but setting up a temp file will avoid this
- we could also set the default chunk size to be very large so as to avoid additional storage being needed in most cases?
Deliverables
Additional work
Risks
OK/Cancel for "upload files"? ie finish upload/transactions when click save, not after picking.
- preview would have to be done client side
- Pro:
- lets you change your mind about upload before a db transaction happens.
- could allow you to edit title or other metadata before you upload?
- con:
- UI would work differently when TUS is turned off. files either have to be uploaded on save button or objects created directly after upload without TUS since its not a two step process.
- user might not realise they need to click save otherwise upload is lost
- last step can take a long time depending on how the serverside is arranged (if tmp and blobs on seperate disks or blobs stored in the DB). Would there need to be an additional progress for this?
Size of bundle with extra lib
- it's pretty small and its easier to maintain if all the code uses the same method client code to do uploads.
File Widget
- upload on save vs upload on pick. which works best?
Participants
Context
Related optimisation on the backend to speed up the last part of a large upload
PLIP (Plone Improvement Proposal)
Abstract
This PLIP has three aims (and could be separated if desired)
Context
Motivation
Assumptions
Folder contents > uploadis a currently “hidden feature”Add > Fileis too many clicks for most people and it’s not obvious the title is optionalProposal & Implementation
TUS for contents upload
TUS for file fields/blocks
Replace Add > File
UI for "upload files"
propose to make similar to quanta (but with semantic)
Additional things not specified in quanta design
TUS without temp folder
Deliverables
Additional work
Risks
OK/Cancel for "upload files"? ie finish upload/transactions when click save, not after picking.
Size of bundle with extra lib
File Widget
Participants
Context
Related optimisation on the backend to speed up the last part of a large upload