# Patient document uploads in bahmni

**URL:** <https://talk.openmrs.org/t/patient-document-uploads-in-bahmni/23675>\
**Category:** Bahmni\
**Tags:** bahmni\
**Created:** [June 24, 2019, 3:58am UTC](https://talk.openmrs.org/t/patient-document-uploads-in-bahmni/23675 "2019-06-24T03:58:10Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![mithu](https://talk.openmrs.org/letter_avatar/mithu/32/6_22734026db12803ebb3e059622ac3534.png) [@mithu](https://talk.openmrs.org/u/mithu)\
**Post date:** [June 24, 2019, 3:58am UTC](https://talk.openmrs.org/t/patient-document-uploads-in-bahmni/23675/1 "2019-06-24T03:58:10Z")

</div>

Hello guys… I want to know more about patient document upload features in bahmni. Actualy where the uploaded documents are saving and in which format its saving?? And i have a doubt, if it is saved as image format is there is any option for link any other server path in our network so that image should be saved in that location?? Is it possible to fix the path??

Regards Mithun G

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [June 24, 2019, 8:20am UTC](https://talk.openmrs.org/t/patient-document-uploads-in-bahmni/23675/2 "2019-06-24T08:20:49Z")

</div>

Moved to the bahmni category.

---

<div class="post-metadata">

**Author:** ![angshuonline](https://talk.openmrs.org/user_avatar/talk.openmrs.org/angshuonline/32/4925_2.png) [@angshuonline](https://talk.openmrs.org/u/angshuonline)\
**Post date:** [June 25, 2019, 10:07am UTC](https://talk.openmrs.org/t/patient-document-uploads-in-bahmni/23675/3 "2019-06-25T10:07:09Z")

</div>

all such uploaded documents would be by default stored in subdirectories under “/home/bahmni/document\_images/” You can find the configuration in “/opt/openmrs/bahmnicore.properties” against “bahmnicore.documents.baseDirectory” key.

---

<div class="post-metadata">

**Author:** ![mithu](https://talk.openmrs.org/letter_avatar/mithu/32/6_22734026db12803ebb3e059622ac3534.png) [@mithu](https://talk.openmrs.org/u/mithu)\
**Post date:** [June 26, 2019, 6:06am UTC](https://talk.openmrs.org/t/patient-document-uploads-in-bahmni/23675/4 "2019-06-26T06:06:40Z")

</div>

Thank you…

---

<div class="post-metadata">

**Author:** ![chandhana](https://talk.openmrs.org/letter_avatar/chandhana/32/6_22734026db12803ebb3e059622ac3534.png) [@chandhana](https://talk.openmrs.org/u/chandhana)\
**Post date:** [January 12, 2024, 11:56am UTC](https://talk.openmrs.org/t/patient-document-uploads-in-bahmni/23675/5 "2024-01-12T11:56:46Z")

</div>

Hi @gsluthra and @mohant,

All the images, patient documents, radiology uploads are getting uploaded to the docker location /home/bahmni/document\_images/100 but while retrieving it, it is showing 301 permanently moved and 404 not found. So, the document or image is displayed as broken in the UI.

Please find the screenshots attached.

 ![image](https://talk.openmrs.org/uploads/default/original/3X/f/5/f529d97f0351ab791c7a37d09a892d3640529edc.png)

 ![image](https://talk.openmrs.org/uploads/default/original/3X/8/3/83a36f8e1bb0f2a1771e9404fc2a5395c6fb7734.png)

 ![image](https://talk.openmrs.org/uploads/default/original/3X/1/1/11e2580230bd189dc854c8fa008a238f383608bc.png)

 ![image](https://talk.openmrs.org/uploads/default/original/3X/5/0/5024240ff7b00020f74ded9f2c4952732d05eb71.png)

 ![image](https://talk.openmrs.org/uploads/default/original/3X/7/b/7b83985176e995296ac641de3a05eae46724f7b7.png)

---

<div class="post-metadata">

**Author:** ![gsluthra](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gsluthra/32/1453_2.png) [@gsluthra](https://talk.openmrs.org/u/gsluthra)\
**Post date:** [January 15, 2024, 5:45am UTC](https://talk.openmrs.org/t/patient-document-uploads-in-bahmni/23675/6 "2024-01-15T05:45:15Z")

</div>

Is this a related issue?

[https://bahmni.atlassian.net/browse/BAH-3335](https://bahmni.atlassian.net/browse/BAH-3335)

---

<div class="post-metadata">

**Author:** ![umairfayaz](https://talk.openmrs.org/letter_avatar/umairfayaz/32/6_22734026db12803ebb3e059622ac3534.png) [@umairfayaz](https://talk.openmrs.org/u/umairfayaz)\
**Post date:** [January 16, 2024, 6:09am UTC](https://talk.openmrs.org/t/patient-document-uploads-in-bahmni/23675/7 "2024-01-16T06:09:22Z")

</div>

@chandhana, can you please check the directory permissions for ‘document\_images’ and its subdirectories using the `ls -l`. Ensure that the “Other user” has read permission.

---

<div class="post-metadata">

**Author:** ![chandhana](https://talk.openmrs.org/letter_avatar/chandhana/32/6_22734026db12803ebb3e059622ac3534.png) [@chandhana](https://talk.openmrs.org/u/chandhana)\
**Post date:** [January 16, 2024, 10:32am UTC](https://talk.openmrs.org/t/patient-document-uploads-in-bahmni/23675/8 "2024-01-16T10:32:43Z")

</div>

Yes, I have followed these steps to fix the issue, but the build failed with error at 170 line in docker-compose.yml file.

 ![image](https://talk.openmrs.org/uploads/default/original/3X/1/1/114219b6b9a0eab3fffdb1b6a74fc66e5472b26e.png)

Will only these 3 changes from the commit be enough to fix the issue?

> <https://github.com/Bahmni/bahmni-docker/pull/62/files>
>
> JIRA Card: https://bahmni.atlassian.net/browse/BAH-3335
> Due to this missing var…iable, the files uploaded with patient documents module has insufficient file permissions. As a result \`patient-documents\` service was not able to read and serve the documents and gave 404 error. This is configuration added in Bahmni Lite. JIRA Card for fix on bahmni-lite: https://bahmni.atlassian.net/browse/BAH-2650

---

<div class="post-metadata">

**Author:** ![chandhana](https://talk.openmrs.org/letter_avatar/chandhana/32/6_22734026db12803ebb3e059622ac3534.png) [@chandhana](https://talk.openmrs.org/u/chandhana)\
**Post date:** [January 16, 2024, 10:33am UTC](https://talk.openmrs.org/t/patient-document-uploads-in-bahmni/23675/9 "2024-01-16T10:33:54Z")

</div>

@umairfayaz I have manually changed the permissions and given read permissions to other user in the docker container and tested but still facing the same issue.

---

<div class="post-metadata">

**Author:** ![gsluthra](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gsluthra/32/1453_2.png) [@gsluthra](https://talk.openmrs.org/u/gsluthra)\
**Post date:** [January 19, 2024, 9:34am UTC](https://talk.openmrs.org/t/patient-document-uploads-in-bahmni/23675/10 "2024-01-19T09:34:28Z")

</div>

Can you pull the latest docker images (and use latest docker-compose.yml, and .env files) and retry this? I feel like things should just work out-of-the-box, and these are likely some local changes on your machine that are causing things to not work.

If you can reset to latest Bahmni docker images (ensure you are pulling `latest`) and then make your changes step-by-step, it will be easier for u to debug which change breaks the doc upload functionality.

---

<div class="post-metadata">

**Author:** ![chandhana](https://talk.openmrs.org/letter_avatar/chandhana/32/6_22734026db12803ebb3e059622ac3534.png) [@chandhana](https://talk.openmrs.org/u/chandhana)\
**Post date:** [January 23, 2024, 2:00pm UTC](https://talk.openmrs.org/t/patient-document-uploads-in-bahmni/23675/11 "2024-01-23T14:00:18Z")

</div>

Hi @gsluthra,

We have commented the default-config and are using our custom config module. Does this effect the upload document functionality in any way. Because rest all configurations are same in the docker-compose file.

Also, should we add any specific roles or privileges like app:document-upload, because I have given this to my user but still the issue is not resolved.

One update would be, now the issue is 403 forbidden and not 404 not found.

Can you please let us know what we can do to fix this at the earliest.

![image](https://talk.openmrs.org/uploads/default/original/3X/e/e/eed31a214fecd21146ce05bf902149efed90c39c.png)

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

---

<div class="post-metadata">

**Author:** ![gsluthra](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gsluthra/32/1453_2.png) [@gsluthra](https://talk.openmrs.org/u/gsluthra)\
**Post date:** [January 24, 2024, 6:56am UTC](https://talk.openmrs.org/t/patient-document-uploads-in-bahmni/23675/12 "2024-01-24T06:56:36Z")

</div>

Hi @chandhana - I have created a new bug for this: [[BAH-3498] - Bahmni - JIRA](https://bahmni.atlassian.net/browse/BAH-3498) Please provide any additional information here. Will request someone from the team to pick this up today/tomorrow.

---

<div class="post-metadata">

**Author:** ![mohant](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mohant/32/15443_2.png) [@mohant](https://talk.openmrs.org/u/mohant)\
**Post date:** [February 21, 2024, 5:12pm UTC](https://talk.openmrs.org/t/patient-document-uploads-in-bahmni/23675/13 "2024-02-21T17:12:15Z")

</div>

Hello @chandhana The issue seems to be with proxy rule forwarding. Please take a read at this troubleshooting step here. [https://bahmni.atlassian.net/wiki/spaces/BAH/pages/3119710209/Common+Troubleshooting+Guide+docker#Getting-404-Error-when-accessing-patient-documents-or-implementer-interface-or-some-service-of-Bahmni%3A](https://bahmni.atlassian.net/wiki/spaces/BAH/pages/3119710209/Common+Troubleshooting+Guide+docker#Getting-404-Error-when-accessing-patient-documents-or-implementer-interface-or-some-service-of-Bahmni%3A)

Let us know if you still face the issue. Thanks
