# Attachment widget to display PDF uploaded from HTML Form Entry

**URL:** https://talk.openmrs.org/t/attachment-widget-to-display-pdf-uploaded-from-html-form-entry/29222
**Category:** Development
**Tags:** attachments
**Created:** [June 29, 2020, 11:58am UTC](https://talk.openmrs.org/t/attachment-widget-to-display-pdf-uploaded-from-html-form-entry/29222 "2020-06-29T11:58:10Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![premnisha](https://talk.openmrs.org/letter_avatar/premnisha/32/5_5575768a8748004e209b776fc1b2916d.png) [@premnisha](https://talk.openmrs.org/u/premnisha)
#### Post date: [June 29, 2020, 11:58am UTC](https://talk.openmrs.org/t/attachment-widget-to-display-pdf-uploaded-from-html-form-entry/29222/1 "2020-06-29T11:58:10Z")

</div>

Hello everyone,

We would like to upload the PDF using the Default Attachment Handler from the html form entry module.

If a PDF is uploaded directly from the attachment module, the thumbnails of the PDF are shown as below.

 ![image|690x835;50%](https://talk.openmrs.org/uploads/default/original/2X/7/77aae670fcc760ddab100c909d1712c88a11ff1d.jpeg)

The same thing added from the forms (build on html form entry) does not show as thumbnail images in attachments widget. Although it gets stored in the same `complex_obs` directory

@mksd @dkayiwa @mogoodrich Please let us know your thoughts on this.

cc @sukreet @mddubey @vasanth2019

---

<div class="post-metadata">

### Author: ![mksd](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mksd/32/11729_2.png) [@mksd](https://talk.openmrs.org/u/mksd)
#### Post date: [June 29, 2020, 12:07pm UTC](https://talk.openmrs.org/t/attachment-widget-to-display-pdf-uploaded-from-html-form-entry/29222/2 "2020-06-29T12:07:01Z")

</div>

@premnisha I suspect that you did not add the concept complex that you use in your forms as a concept complex that is on Attachments radar. This is controlled by the GP `"attachments.conceptComplexUuidList"`, see [here](https://github.com/openmrs/openmrs-module-attachments/blob/121f89a3cfa9e0359dc9f710409ba5516a3f720e/omod/src/main/resources/config.xml#L61-L62).

---

<div class="post-metadata">

### Author: ![premnisha](https://talk.openmrs.org/letter_avatar/premnisha/32/5_5575768a8748004e209b776fc1b2916d.png) [@premnisha](https://talk.openmrs.org/u/premnisha)
#### Post date: [June 29, 2020, 1:37pm UTC](https://talk.openmrs.org/t/attachment-widget-to-display-pdf-uploaded-from-html-form-entry/29222/3 "2020-06-29T13:37:58Z")

</div>

@mksd The concept created to upload the default attachment is attached below

 ![image](https://talk.openmrs.org/uploads/default/original/2X/d/da97ea940fdf6a6f07c3ae31d0dabcc19fa10e3f.png)

Concept of the default attachment handler in the system is as shown below. The UUID matches with the global properties [configured](https://github.com/openmrs/openmrs-module-attachments/blob/121f89a3cfa9e0359dc9f710409ba5516a3f720e/omod/src/main/resources/config.xml#L61-L62).

 ![image](https://talk.openmrs.org/uploads/default/original/2X/2/24995be427e88acd197c24bad66d75824fbd4bbc.png)

Please let me know if I am missing something

---

<div class="post-metadata">

### Author: ![mksd](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mksd/32/11729_2.png) [@mksd](https://talk.openmrs.org/u/mksd)
#### Post date: [June 29, 2020, 2:50pm UTC](https://talk.openmrs.org/t/attachment-widget-to-display-pdf-uploaded-from-html-form-entry/29222/4 "2020-06-29T14:50:44Z")

</div>

@premnisha you’d need to add the UUID of this concept 174184 (the one with the UUID starting with `"98928c70"`) in the list that is the value of the GP. Something like that:

```json
["7cac8397-53cd-4f00-a6fe-028e8d743f8e","42ed45fd-f3f6-44b6-bfc2-8bde1bb41e00",
  "98928c70-..."]

```

---

<div class="post-metadata">

### Author: ![premnisha](https://talk.openmrs.org/letter_avatar/premnisha/32/5_5575768a8748004e209b776fc1b2916d.png) [@premnisha](https://talk.openmrs.org/u/premnisha)
#### Post date: [June 29, 2020, 3:10pm UTC](https://talk.openmrs.org/t/attachment-widget-to-display-pdf-uploaded-from-html-form-entry/29222/5 "2020-06-29T15:10:11Z")

</div>

Thank you @mksd, adding that works.
