# File upload field in custom form

**URL:** <https://support.primero.org/forum/t/file-upload-field-in-custom-form/186>\
**Category:** Primero IMS\
**Tags:** v1-6\
**Created:** [March 19, 2019, 12:49pm UTC](https://support.primero.org/forum/t/file-upload-field-in-custom-form/186 "2019-03-19T12:49:34Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![irlawrence](https://support.primero.org/forum/user_avatar/support.primero.org/irlawrence/32/8_2.png) [@irlawrence](https://support.primero.org/forum/u/irlawrence)\
**Post date:** [March 19, 2019, 12:49pm UTC](https://support.primero.org/forum/t/file-upload-field-in-custom-form/186/1 "2019-03-19T12:49:34Z")

</div>

Hi,  
We have installed primero in our system and started using it.

> **[primeroIMS/primero](https://github.com/primeroIMS/primero)**
>
> Primero is an application designed to help child protection workers and social workers in humanitarian and development contexts manage data on vulnerable children and survivors of violence. Please...

We have created some of the custom forms and we want file upload field to be added in that.  
How can we achieve the same?

---

<div class="post-metadata">

**Author:** ![community](https://support.primero.org/forum/user_avatar/support.primero.org/community/32/1_2.png) [@community](https://support.primero.org/forum/u/community)\
**Post date:** [March 19, 2019, 12:53pm UTC](https://support.primero.org/forum/t/file-upload-field-in-custom-form/186/2 "2019-03-19T12:53:24Z")

</div>

## Helpdesk issue was created by Ian Lawrence: File upload field on custom form

---

<div class="post-metadata">

**Author:** ![community](https://support.primero.org/forum/user_avatar/support.primero.org/community/32/1_2.png) [@community](https://support.primero.org/forum/u/community)\
**Post date:** [March 19, 2019, 1:07pm UTC](https://support.primero.org/forum/t/file-upload-field-in-custom-form/186/3 "2019-03-19T13:07:14Z")

</div>

## New public comment was posted to Helpdesk by Ian Lawrence

Anything to do with file attachments has to be done through JSON. (export the configuration bundle using the UI) However, we may have done some hardcoding, so there is a high risk of issues if you put file attachments on any other form besides the current ones

---

<div class="post-metadata">

**Author:** ![pawankumar.singh](https://support.primero.org/forum/letter_avatar_proxy/v4/letter/p/e19b73/32.png) [@pawankumar.singh](https://support.primero.org/forum/u/pawankumar.singh)\
**Post date:** [April 11, 2019, 6:42am UTC](https://support.primero.org/forum/t/file-upload-field-in-custom-form/186/4 "2019-04-11T06:42:26Z")

</div>

I have created many custom form and each form should have a field for file upload. Please if it possible for you to explain with proper details how to add file upload field in each form.

---

<div class="post-metadata">

**Author:** ![irlawrence](https://support.primero.org/forum/user_avatar/support.primero.org/irlawrence/32/8_2.png) [@irlawrence](https://support.primero.org/forum/u/irlawrence)\
**Post date:** [April 11, 2019, 2:00pm UTC](https://support.primero.org/forum/t/file-upload-field-in-custom-form/186/5 "2019-04-11T14:00:41Z")

</div>

First export a configuration bundle. To do that look at the docs here [https://support.primero.org/books/primeroIMS/PrimeroConfigurationProcessGuide/master/PrimeroConfigurationProcessGuide.html#configure](https://support.primero.org/books/primeroIMS/PrimeroConfigurationProcessGuide/master/PrimeroConfigurationProcessGuide.html#configure). Inside you will find something which looks like this for upload fields.  
“fields”: [  
{  
“visible”: true,  
“mobile\_visible”: true,  
“highlight\_information”: {  
“highlighted”: false  
},  
“multi\_select”: false,  
“required”: false,  
“show\_on\_minify\_form”: false,  
“hidden\_text\_field”: false,  
“autosum\_total”: false,  
“autosum\_group”: “”,  
“create\_property”: true,  
“hide\_on\_view\_page”: false,  
“name”: “upload\_bia\_document”,  
“type”: “document\_upload\_box”,  
“editable”: false,  
“disabled”: true,  
“display\_name\_en”: “BIA Document”,  
“display\_name\_fr”: “BIA Document”,  
“display\_name\_ar”: “BIA Document”,  
“display\_name\_es”: “BIA Document”,  
“base\_language”: “en”  
}

On your custom forms you need to make something like this for an upload field.

---

<div class="post-metadata">

**Author:** ![pawankumar.singh](https://support.primero.org/forum/letter_avatar_proxy/v4/letter/p/e19b73/32.png) [@pawankumar.singh](https://support.primero.org/forum/u/pawankumar.singh)\
**Post date:** [April 16, 2019, 12:38pm UTC](https://support.primero.org/forum/t/file-upload-field-in-custom-form/186/8 "2019-04-16T12:38:42Z")

</div>

As per above suggestion, I am able to create upload field in form.  
Uploaded file is accessible in edit section, but in view section of the form, I am not able to view the uploaded file.  
As its a BIA Document type I request for approval even after approving the document the red Exclamation sign doesn’t go and still, I was unable to see my document  
Is there any way to access/view uploaded file in the view section?  
Awaiting reply on the same.  
Thanks.

---

<div class="post-metadata">

**Author:** ![irlawrence](https://support.primero.org/forum/user_avatar/support.primero.org/irlawrence/32/8_2.png) [@irlawrence](https://support.primero.org/forum/u/irlawrence)\
**Post date:** [April 17, 2019, 1:29pm UTC](https://support.primero.org/forum/t/file-upload-field-in-custom-form/186/9 "2019-04-17T13:29:46Z")

</div>

This is probably related to permissions. What permissions does the role have to view?

---

<div class="post-metadata">

**Author:** ![pawankumar.singh](https://support.primero.org/forum/letter_avatar_proxy/v4/letter/p/e19b73/32.png) [@pawankumar.singh](https://support.primero.org/forum/u/pawankumar.singh)\
**Post date:** [May 13, 2019, 10:51am UTC](https://support.primero.org/forum/t/file-upload-field-in-custom-form/186/10 "2019-05-13T10:51:35Z")

</div>

Can you please suggest what permission it should have to view the document uploaded?

---

<div class="post-metadata">

**Author:** ![irlawrence](https://support.primero.org/forum/user_avatar/support.primero.org/irlawrence/32/8_2.png) [@irlawrence](https://support.primero.org/forum/u/irlawrence)\
**Post date:** [May 13, 2019, 11:16am UTC](https://support.primero.org/forum/t/file-upload-field-in-custom-form/186/11 "2019-05-13T11:16:49Z")

</div>

The role needs to have the view permission.Note that:

To edit the properties of an existing role, find the name and click _Edit_ in the options in the right column. From the _Show_ page, click the EDIT button at the top of the screen… Click on the SAVE button once all the desired information has been changed or entered.

A few hints for setting roles:

- When creating the role, if you do not check any forms, users with this role will see the default set of forms for the modules assigned when their username is created. However, if you check even one form in Case, Incident, or Tracing Requests, you must click all the forms the role should access in all three groups of forms.
- Record Owner is a required form. If you are selecting forms, you must include Record Owner with any other forms within the group otherwise users with this role will be crippled. The Record Owner form must be selected within each group of Case, Incident and Tracing Request forms. Selecting it once is not adequate.
- The list of forms for Cases contains forms for both the CP and GBV modules and, likewise. For the user to see the form, the role must have access to the form and the username must have access to the module.
