-
Notifications
You must be signed in to change notification settings - Fork 171
Allow additional metadata to be passed on upload for addons and hooks #2334
Description
Right now, there is no really good way to attach additional metadata to uploads, e.g. if you know the correspondent of a document. The metadata structure of the upload endpoints have a fixed set of fields, and the upload API calls do not return any information that the caller could use to construct a subsequent API call to update a specific document.
If using an addon for post-processing, or a job-done hook, the only somewhat unique information available about the document is the filename, which the addon/hook could use to look up the metadata that was available at upload time, and then do its magic. Since filenames are only unique as absolute paths (and even then, Windows doesn't guarantee that), the filename would have to be set to the absolute path on upload, else there is a risk of collision.
It is possible to change the item name from an addon, or via API call, but it is not possible to change the names of attachments, thus the absolute path would remain permanently exposed/encoded in the DMS.
One possible solution could involve the item ID returned in the upload API response (#2327), but that still means that the caller would have to deal with the asynchronous nature of the processing pipeline.
If the meta structure provided during upload could grow another field in which the caller could provide any additional information for addons/hooks to later process, then it would actually be trivial to properly inject available metadata at upload time, and have access to it during post-processing.