# Documents don't upload

**URL:** <https://community.open-emr.org/t/documents-dont-upload/1061>\
**Category:** Management and Administration\
**Created:** [February 10, 2012, 11:27am UTC](https://community.open-emr.org/t/documents-dont-upload/1061 "2012-02-10T11:27:40Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [February 10, 2012, 11:27am UTC](https://community.open-emr.org/t/documents-dont-upload/1061/1 "2012-02-10T11:27:40Z")

</div>

**[rdh61](https://sourceforge.net/u/rdh61/)** wrote on [Friday, February 10, 2012](https://sourceforge.net/p/openemr/discussion/202505/thread/6d15b628/#9978):

Hi,

Version 4.1 on ubuntu 10.10 and firefox.

I have one patient on my database for whom no documents will upload. The same documents will upload successfully for other patients on the database.

Very odd. I have no idea what to do about it.

Any help gratefully received.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [February 10, 2012, 4:59pm UTC](https://community.open-emr.org/t/documents-dont-upload/1061/2 "2012-02-10T16:59:41Z")

</div>

**[aethelwulffe](https://sourceforge.net/u/aethelwulffe/)** wrote on [Friday, February 10, 2012](https://sourceforge.net/p/openemr/discussion/202505/thread/6d15b628/#e6b2):

open patient,  
go to admin/ practice/ documents,&nbsp; update files….see if that does anything. (dunno if this really works!&nbsp; Looks like it should update the files……)

Look at the patient’s documents, note what is supposed to be there.&nbsp; Look at openemr/sites/default/documents/PID#, see if it is any different.&nbsp; If there is no directory for that PID, or something is funny, you got a problem.&nbsp; Possibly someone has played with those files.&nbsp; You should not (ever) manipulate those files directly.

There are other things to check, but this is a quick easy start.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [February 11, 2012, 10:05am UTC](https://community.open-emr.org/t/documents-dont-upload/1061/3 "2012-02-11T10:05:05Z")

</div>

**[rdh61](https://sourceforge.net/u/rdh61/)** wrote on [Saturday, February 11, 2012](https://sourceforge.net/p/openemr/discussion/202505/thread/6d15b628/#7959):

(1) admin/practice/documents/update files didn’t do anything to change the situation.

(2) Patient’s PID# directory and document files are present at openemr/sites/default/documents.

(3) On further investigation I found that I could only successfully upload new documents for patients entered to the database AFTER upgrading from version 3.2.

(4) For patients entered entered to the database BEFORE upgrading from version 3.2, I can neither upload new documents (no error message - just doesn’t work), nor open documents listed as present, even though they are present at openemr/sites/default/documents/PID#.

(5) In this latter case, the error message is: The requested document is not present at the expected location on the filesystem or there are not sufficient permissions to access it. /var/www/openemr/documents/PID#/document\_name.odt

So, it seems that openemr is looking for the documents using the wrong path. How can I correct this?

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [February 11, 2012, 5:15pm UTC](https://community.open-emr.org/t/documents-dont-upload/1061/4 "2012-02-11T17:15:13Z")

</div>

**[bradymiller](https://sourceforge.net/u/bradymiller/)** wrote on [Saturday, February 11, 2012](https://sourceforge.net/p/openemr/discussion/202505/thread/6d15b628/#fd75):

Hi,

The path thing has been dealt with (the change in paths to documents from 3.2 to 4.0), so this shouldn’t be causing problems. Is the error showing on the screen or in the php error log? The fact that you can’t upload new docs along with view them makes me think there is a permission issue? What is the operating system that you are using? Do you note any permission differences between the directories of the pre-upgrade patients and post-upgrade patients?

-brady

> **[OpenEMR](https://www.open-emr.org)**
>
> The world's leading open-source electronic medical record and practice management software.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [February 11, 2012, 5:48pm UTC](https://community.open-emr.org/t/documents-dont-upload/1061/5 "2012-02-11T17:48:05Z")

</div>

**[rdh61](https://sourceforge.net/u/rdh61/)** wrote on [Saturday, February 11, 2012](https://sourceforge.net/p/openemr/discussion/202505/thread/6d15b628/#1c1a):

1) The message “The requested document is not present at the expected location on the filesystem or there are not sufficient permissions to access it. /var/www/openemr/documents/PID#/document\_name.odt” appears **_on the screen_** when I try to upload a document. I understand though that the path **_should be_** : openemr/sites/default/documents, _ **not** _ openemr/documents. (??)

2) OS = ubuntu 10.04. (I said 10.10 above, a mistake).

3) Pre-upgrade files’ owner is given as “root”. Post-upgrade files’ owner is given as “www-data”.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [February 11, 2012, 5:56pm UTC](https://community.open-emr.org/t/documents-dont-upload/1061/6 "2012-02-11T17:56:40Z")

</div>

**[bradymiller](https://sourceforge.net/u/bradymiller/)** wrote on [Saturday, February 11, 2012](https://sourceforge.net/p/openemr/discussion/202505/thread/6d15b628/#1619):

Yep,

This is a permissions error. Make the owner of all of the files in your documents directory to be www-data (this is the apache server, so will give it permission to place new files and view files in all directories).

```
sudo chown -R www-data:www-data /var/www/openemr/sites/default/documents

```

-brady

> **[OpenEMR](https://www.open-emr.org)**
>
> The world's leading open-source electronic medical record and practice management software.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [February 11, 2012, 6:30pm UTC](https://community.open-emr.org/t/documents-dont-upload/1061/7 "2012-02-11T18:30:55Z")

</div>

**[rdh61](https://sourceforge.net/u/rdh61/)** wrote on [Saturday, February 11, 2012](https://sourceforge.net/p/openemr/discussion/202505/thread/6d15b628/#12d8):

Yes, that worked. I can now upload and view documents for all patients. Many thanks.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [February 11, 2012, 11:19pm UTC](https://community.open-emr.org/t/documents-dont-upload/1061/8 "2012-02-11T23:19:33Z")

</div>

**[tmccormi](https://sourceforge.net/u/tmccormi/)** wrote on [Saturday, February 11, 2012](https://sourceforge.net/p/openemr/discussion/202505/thread/6d15b628/#6a99):

That does bring up the fact the error message is invalid and misleading, the displayed path is not the one that it was having trouble with, it is the OLD path format…  
-Tony

> **[MI-Squared - Medical Information Integration - mi-squared](https://mi-squared.com/)**
>
> \[vc\_row padding\_top\_multiplier=”custom” padding\_bottom\_multiplier=”2x” rc\_heading\_color=”light” rc\_bg\_type=”image” rc\_bg\_image=”6313″ rc\_bg\_image\_type=”parallax” rc\_bg\_color\_overlay=”dark” rc\_bg\_opacity\_overlay=”60″ rc\_add\_shadow=”large-shadow”...

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [February 5, 2014, 11:12am UTC](https://community.open-emr.org/t/documents-dont-upload/1061/9 "2014-02-05T11:12:49Z")

</div>

**[mwestrik](https://sourceforge.net/u/mwestrik/)** wrote on [Wednesday, February 05, 2014](https://sourceforge.net/p/openemr/discussion/202505/thread/6d15b628/#b03f):

I realize this is an old topic, but i do have the same problem now, all of a sudden. It has worked all the time, but not anymore since recently.

Uploading the files through the website seems to work, the status indicator goes from 1 to 100%, but after that nothing. Checking the dir shows the file isnt there.  
Copying the files manually into the patients directory doesnt help either. They will appear in the dir, but not on the website. Old previously uploaded files are still visible though.

what can be the cause of the uploads all of a sudden not working anymore? Maybe a php update on the server?

we’re running OpenEMR version 4.1.0 (7)

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [February 5, 2014, 11:15am UTC](https://community.open-emr.org/t/documents-dont-upload/1061/10 "2014-02-05T11:15:15Z")

</div>

**[mwestrik](https://sourceforge.net/u/mwestrik/)** wrote on [Wednesday, February 05, 2014](https://sourceforge.net/p/openemr/discussion/202505/thread/6d15b628/#902a):

some possibly helpful additional information: the server is now running:

Apache-version 2.2.22  
PHP-version 5.2.17

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [February 5, 2014, 12:13pm UTC](https://community.open-emr.org/t/documents-dont-upload/1061/11 "2014-02-05T12:13:32Z")

</div>

**[yehster](https://sourceforge.net/u/yehster/)** wrote on [Wednesday, February 05, 2014](https://sourceforge.net/p/openemr/discussion/202505/thread/6d15b628/#9c42):

Did you try changing the directory permissions as described in an earlier message in the thread?

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [February 5, 2014, 2:15pm UTC](https://community.open-emr.org/t/documents-dont-upload/1061/12 "2014-02-05T14:15:53Z")

</div>

**[mwestrik](https://sourceforge.net/u/mwestrik/)** wrote on [Wednesday, February 05, 2014](https://sourceforge.net/p/openemr/discussion/202505/thread/6d15b628/#7dba):

when doing it, I only get:

chown: invalid user: `www-data:www-data’

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [February 5, 2014, 7:47pm UTC](https://community.open-emr.org/t/documents-dont-upload/1061/13 "2014-02-05T19:47:34Z")

</div>

**[yehster](https://sourceforge.net/u/yehster/)** wrote on [Wednesday, February 05, 2014](https://sourceforge.net/p/openemr/discussion/202505/thread/6d15b628/#7dba/7426):

Suggests to me that either your system is configured to run apache with a different user account than www-data or something got corrupted with the user accounts on your system.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [February 6, 2014, 8:33am UTC](https://community.open-emr.org/t/documents-dont-upload/1061/14 "2014-02-06T08:33:55Z")

</div>

**[mwestrik](https://sourceforge.net/u/mwestrik/)** wrote on [Thursday, February 06, 2014](https://sourceforge.net/p/openemr/discussion/202505/thread/6d15b628/#8120):

already contacted the host, they couldn’t or wouldn’t help me with that.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [February 6, 2014, 1:30pm UTC](https://community.open-emr.org/t/documents-dont-upload/1061/15 "2014-02-06T13:30:27Z")

</div>

**[mwestrik](https://sourceforge.net/u/mwestrik/)** wrote on [Thursday, February 06, 2014](https://sourceforge.net/p/openemr/discussion/202505/thread/6d15b628/#e895):

well, I have succeeded in changing the permissions. for the record: www-data is the user on Ubuntu machines. For CentoS machines, that user is apache.

But still, the problem stays the same.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [February 12, 2014, 12:32pm UTC](https://community.open-emr.org/t/documents-dont-upload/1061/16 "2014-02-12T12:32:08Z")

</div>

**[mwestrik](https://sourceforge.net/u/mwestrik/)** wrote on [Wednesday, February 12, 2014](https://sourceforge.net/p/openemr/discussion/202505/thread/6d15b628/#0c60):

in fact, it has become worse now. since I’ve done what you said I do get these errors when uploading:

Warning: mkdir() [function.mkdir]: Permission denied in /home/clinical/public\_html/controllers/C\_Document.class.php on line 91

Warning: move\_uploaded\_file(/home/clinical/public\_html/sites/default/documents/40/paspoort.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/clinical/public\_html/controllers/C\_Document.class.php on line 117

Warning: move\_uploaded\_file() [function.move-uploaded-file]: Unable to move ‘/tmp/phpWF6jAW’ to ‘/home/clinical/public\_html/sites/default/documents/40/paspoort.jpg’ in /home/clinical/public\_html/controllers/C\_Document.class.php on line 117

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [February 12, 2014, 2:03pm UTC](https://community.open-emr.org/t/documents-dont-upload/1061/17 "2014-02-12T14:03:27Z")

</div>

**[yehster](https://sourceforge.net/u/yehster/)** wrote on [Wednesday, February 12, 2014](https://sourceforge.net/p/openemr/discussion/202505/thread/6d15b628/#8bc0):

It still seems like a problem with permissions, to me, but I’ll defer to someone else with more experience with CentOS, given that I’ve led you astray so far.
