...
PIPEFORCE Forms also supports file uploads and file previews.
In order to To make a widget in a form a file an upload widget, you have need to do follow these steps:
Step 1: Add a content reference object to your Form Schema
The widget which should become the upload widget must be declared of type object
in the Form Schema. The object
must, in term must turn, contain the properties
for the content reference declaration properties
. See the example below where the widget with id myFile
will be declared by a content reference object.
...
For more details see:
...
Implementation Details
...
In case a form schema contains a content reference section, a file chooser is rendered in the form.
See Content References (ResourcesFiles).The user can click this file chooser and select the local file to be uploaded.
After the user has selected the file, the browser creates a temp property in the property store at location
global/tmp/{randomUuid}
.The browser then immediately starts the file upload and adds it as attachment to this tmp property. If there are more than one file to be uploaded, all files will be added to this property as attachment. The name of the attachment will be set to the original name of the file.
See Property Attachments.All content reference fields will be updated by the browser as followed:
The
name
field will be set to the original file name.The
contentLength
will be set to the size of the file.The
contentType
will be set to the type of the file (if possible).The
contentEncoding
for will be set tooutbound-url
.The
content
field will be set to the PIPEFORCE URI pointing to the tmp property. For example:$uri:property:global/tmp/adfe1656-2bb7-11ee-be56-0242ac120002
If finally the user submits the form, all form data including the updated content reference part will be stored in the property store at the output path as configured by the
output
attribute in the Form Config.The
property.created
event is fired and the listening pipeline is called. This pipeline can then further process the form data and move the uploaded files to their final destination if required by moving the tmp property + updating the PIPEFORCE URI in the form data with the final location.
See https://logabit.atlassian.net/wiki/spaces/PA/pages/2545451358/Forms#The-Pipeline-(Controller) .