Uploading Files
To upload files within your Applications, the FileUploader (Widget ui_unified_FileUploader) is often used to enable the user to select a file for upload. But there are many different cases on the required file format depending on your use case (e.g., displaying it in a PDF Viewer or uploading the file). To simplify the file handling after selection, we have introduced new features to our Client-side Business Object SF_File to get the file in the required format for the following process.
Prerequisites
To follow the steps, Simplifier 9 / MAKERS CHOICE 25.05 or newer, and the current version of our Standard Content is required.
Usecase 1 – Selection of 1 file
If you have deactivated the multiple selection of files to be uploaded (Property ‘multiple’ is inactive), you know you can expect only a single file. In this case, connect the Client-side Business Object Function SF_File -> getFile to the change event of your FileUploader.
If you do not configure the input mapping, it will return the file automatically with a base64 string. However, if you need the file to be in a different format (like a data URL or a Blob), you’ll need to map the constant value ‘true’ at the corresponding input parameter (returnDataUrl or returnBlob). In that case, don’t forget to also enable returnBase64 if you still want the base64 string included in the result.
Usecase 2 – Extract multiple files
If you have activated the multiple selection of files to be uploaded (Property ‘multiple’ is active), there might be one or more files chosen by the user. Thus, you need the files as a collection. In this case, connect the Client-side Business Object Function SF_File -> getFiles to the change event of your FileUploader and use the Function’s Process Output. Everything else works like in Usecase 1.