Question

How to do a file upload in Pega thru Pega Views

Hi,

I am new to Pega. I have created a case type with different Stages and Steps and configure views.

In one of these views I want have a file upload facility where the user on click of button can open the conventional windows file selection dialog box and can select the file which he/she wants to upload and on selection the same file will be uploaded.

Can you please guide me providing step by step actions to do so.

Thanks in advance for your help.

Warm regards

Shibashis

***Edited by Moderator Marissa to update platform capability tags****

Comments

Keep up to date on this post and subscribe to comments

December 4, 2019 - 6:38am

Hi,

Create a button and provide click event with action as local action. Call a flow action with modal dialog to ask for the filename to upload. call post activity to save on data-workattach-file.

 

Pega
December 4, 2019 - 7:09am

Hi,

Thank you for posting your query in Pega Support Community!

You can achieve your requirement by using OOTB AttachContent control. If you want to add the attachment field in the "ConfigureView" , add a field and select the field type as "Attachment" under the "Fancy" type. Below is the screenshot for reference,

At runtime, the UI will look like below,

Hope this helps!

Thanks,

Geeda.

 

December 11, 2019 - 12:47am
Response to GeedA

Thanks a lot for all your help. Yes it works for me

 

Regards

Shibashis

Pega
December 4, 2019 - 7:19am

As an extension to the above comment, you can configure a "Button" control or drag and drop any control and change the control type to "Attach content". Below is the screenshot for reference,

At runtime, the UI will look like below,

On click of the button, a modal window appears to select the file from the directory. After the selection, the file name and category can be modified as per your requirement in the modal dialog.

Once you submit the modal window and submit the form (Step) the attachments that were attached will be displayed under Recent Content in the Right pane.

Thanks,

Geeda.