--- title: "Example: Preview or Download Multiple Files Uploaded from a Previous Task" slug: "example-preview-or-download-multiple-files-uploaded-from-a-previous-task" updated: 2024-09-09T02:47:20Z published: 2024-09-09T02:47:20Z canonical: "docs.processmaker.com/example-preview-or-download-multiple-files-uploaded-from-a-previous-task" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.processmaker.com/llms.txt > Use this file to discover all available pages before exploring further. # Example: Preview or Download Multiple Files Uploaded from a Previous Task Follow an example to either preview or download multiple files in a Screen that have been uploaded from a previous Task in that Request. ## Overview > [!NOTE] > **Intended audience:** Process designers, Web designers, graphic designers, software developers, coding engineers > > **Tags:** Loop control; File Upload control; File Preview control; File Download control; Screen design If multiple files have been uploaded to a [Task](/v1/docs/tasks) within a [Request](/v1/docs/requests-and-cases#what-is-a-request), those files can be previewed and then downloaded from the current Task in that Request. In the [Screen](/v1/docs/screens) of the Task from which to preview or download those multiple files, use a [File Preview](/v1/docs/file-preview-control) control or [File Download](/v1/docs/file-download-control) control, respectively, with a [Loop](/v1/docs/loop-control) control. See the following sections regarding how to view and/or configure each control used in this example: - [Locate the File Upload control to upload multiple files](/v1/docs/example-preview-or-download-multiple-files-uploaded-from-a-previous-task#locate-the-file-upload-control-to-upload-multiple-files) - [Configure the Loop control](/v1/docs/example-preview-or-download-multiple-files-uploaded-from-a-previous-task#configure-the-loop-control) - [Configure the File Preview control](/v1/docs/example-preview-or-download-multiple-files-uploaded-from-a-previous-task#configure-the-file-preview-control) - [Configure the File Download control](/v1/docs/example-preview-or-download-multiple-files-uploaded-from-a-previous-task#undefined) ## Locate the File Upload Control to Upload Multiple Files Follow these steps to locate applicable setting information for the File Upload control in [this example](/v1/docs/example-preview-or-download-multiple-files-uploaded-from-a-previous-task#overview): 1. Locate the [File Upload](/v1/docs/file-upload-control) control from the Screen page [designed to upload multiple files](/v1/docs/file-upload-control#upload-multiple-files). This Screen is used in the previous Task of the Request that the Request participant uploads those files. 2. Note the [**Variable Name** setting](/v1/docs/file-upload-control#variable-panel-settings) value for that File Upload control. This example uses the value `MultiFileUploadControl`. ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/975b4fd5-577f-4e4b-9f52-f32fc6ea792a.png) 3. [Configure the Loop control in the Screen from which to preview and download the multiple files uploaded from this Screen](/v1/docs/example-preview-or-download-multiple-files-uploaded-from-a-previous-task#undefined). ## Configure Controls to Preview Files To preview multiple files for [this example](/v1/docs/example-preview-or-download-multiple-files-uploaded-from-a-previous-task#overview) requires the following controls: - [Configuring a Loop control](/v1/docs/example-preview-or-download-multiple-files-uploaded-from-a-previous-task#configure-the-loop-control-to-preview-files) - [Configuring a File Preview control](/v1/docs/example-preview-or-download-multiple-files-uploaded-from-a-previous-task#configure-the-file-preview-control) ### Configure the Loop Control to Preview Files Follow these steps to configure the Loop control to preview multiple files as in [this example](/v1/docs/example-preview-or-download-multiple-files-uploaded-from-a-previous-task#overview): 1. [Add the Loop control to the Screen page](/v1/docs/loop-control#add-the-control-to-a-processmaker-screen) from which to preview multiple files. 2. From the [**Data Source** setting](/v1/docs/loop-control#data-source), select the **Existing Array** option. ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/e935885d-afbe-4308-b394-335749871390.png) 3. In the [**Variable Name** setting](/v1/docs/loop-control#variable-name) of the Loop control, enter the **Variable Name** setting value from the File Upload control. For this example, enter `MultiFileUploadControl`. 4. [Configure the File Preview control from which to preview the multiple uploaded files](/v1/docs/example-preview-or-download-multiple-files-uploaded-from-a-previous-task#configure-the-file-preview-control). ### Configure the File Preview Control Follow these steps to configure the File Preview control for [this example](/v1/docs/example-preview-or-download-multiple-files-uploaded-from-a-previous-task#overview): 1. [Add the File Preview control to the Screen page](/v1/docs/file-preview-control#add-the-control-to-a-processmaker-screen) from which to preview multiple files. 2. From the [**File Name** setting](/v1/docs/file-preview-control#file-name), enter `file`. ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/f0548f21-c4b0-46c1-a80c-33829c0110f9.png) This value is required because the [Request data](/v1/docs/request-data-and-json) stores each file in within a [JSON array](/v1/docs/json#json-arrays) named from the File Upload control's **Variable Name** setting value; within this JSON array, each file uploaded to the File Upload control is stored in a JSON object with a unique file ID referenced by the key name `file`. This value is not case sensitive. 3. [Configure the controls to download the multiple files](/v1/docs/example-preview-or-download-multiple-files-uploaded-from-a-previous-task#configure-controls-to-download-files). ## Configure Controls to Download Files To download multiple files for [this example](/v1/docs/example-preview-or-download-multiple-files-uploaded-from-a-previous-task#overview) requires the following controls: - [Configuring a Loop control to download files](/v1/docs/example-preview-or-download-multiple-files-uploaded-from-a-previous-task#undefined) - [Configuring a File Download control](/v1/docs/example-preview-or-download-multiple-files-uploaded-from-a-previous-task#configure-the-file-download-control) ### Configure the Loop Control to Download Files Follow these steps to configure the Loop control to preview multiple files as in [this example](/v1/docs/example-preview-or-download-multiple-files-uploaded-from-a-previous-task#overview): 1. [Add the Loop control to the Screen page](/v1/docs/loop-control#add-the-control-to-a-processmaker-screen) from which to download multiple files. 2. From the [**Data Source** setting](/v1/docs/loop-control#data-source), select the **Existing Array** option. ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/e935885d-afbe-4308-b394-335749871390.png) 3. In the [**Variable Name** setting](/v1/docs/loop-control#variable-name) of the Loop control, enter the **Variable Name** setting value from the File Upload control. For this example, enter `MultiFileUploadControl`. These are the same settings as for the [Loop control that contains the File Preview control](/v1/docs/example-preview-or-download-multiple-files-uploaded-from-a-previous-task#configure-the-loop-control-to-preview-files). 4. [Configure the File Download control from which to download the multiple uploaded files](/v1/docs/example-preview-or-download-multiple-files-uploaded-from-a-previous-task#configure-the-file-download-control). ### Configure the File Download Control Follow these steps to configure the File Download control for [this example](/v1/docs/example-preview-or-download-multiple-files-uploaded-from-a-previous-task#overview): 1. [Add the File Download control to the Screen page](/v1/docs/file-download-control#add-the-control-to-a-processmaker-screen) from which to download multiple files. 2. From the **Name** setting, enter `file`. ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/fe3b384d-bbbc-4b2d-8f34-7243e903e7ab.png) This setting is configured for the same reason as that of the [File Preview control in this example](/v1/docs/example-preview-or-download-multiple-files-uploaded-from-a-previous-task#configure-the-file-preview-control).