Uploading and Downloading Large Files with File ReferencesLast Updated: 08/11/2016 Introduced in Verision: 2.0 |
File references allow large files to be saved in the file system rather than memory, but still be usable in the Portal. By default, uploaded files are stored in memory for fast retrieval and indexing. In most circumstances, this way of file processing works well, but when large files enter the pool, the system can be slowed down. It is better to store these files on the server’s file system and to refer to them with file references.
Example
Our example flow will expand on a previous Apply for Financing flow. In this flow, users enter the details of a financing application, including the upload of supporting documents. These files are saved in a process data folder that exists within a Customer folder.
We will begin in our Designer Folder by selecting the Applicant Details Form and clicking the Edit link.
We will select our Multiple File Upload component and, in the Properties tab, change the OutputType from FileData to FileReference.
This completes our form, so we will save it and close the Form Designer.
Back in our Designer Folder, we will select Application Approval Form and click the Edit link.
We will select our Multiple File Download component and, in the Properties tab, change the OutputType from FileData to FileReference.
Files can be downloaded from the file reference via URL or internal reference (direct download). To give users the choice of selecting the download method that works for them, we will select Selectable in the File dropdown.
This completes our form, so we will save it and close the Form Designer.
Next, we will modify our Apply for Financing flow to handle files with file references. We will navigate to the behavior actions folder for our Customer folder: System > Common Data Elements > Folder Behavior Actions > UserType.CustomerFolderBehavior. We will select the Apply for Financing flow and click the Edit link to open it in the Flow Designer.
We will begin by deleting the components that were responsible for adding files to our process folder.
In their place, we will place an Add FileReferences (Persistent Folder) component. We will find it in the Toolbox tab, under the Flow Management category.
In the Mapping Editor, we will map SupportingDocuments to FileReferences.
Once we’ve connected our remaining outcomes, our flow will be complete. We will save it and close the Flow Designer.
To test our modified Apply for Financing flow, we will navigate to a Customer folder and select the Apply for Financing action.
When we navigate to the process folder for this application, we will see our file reference listed. To download the file it references, we can right-click it and select Download File.