How can I get the full URL of a patient document?

ideveloptunisia wrote on Monday, February 17, 2014:

Hello,

I need to get the full URL of a patient document with the same secured functions used in OpenEMR. what I get is a source code of the image into the iFrame. I need to get a .jpg or .jpeg file to use it as at input file type as a value.

When I try to access the file from URL I get this message :

Forbidden

You don’t have permission to access /openemr/sites/default/documents/xx/xxxxxxxxxx.jpg on this server.

Thanks in advance for your help.

blankev wrote on Monday, February 17, 2014:

https:// YourSecretDirectory/etc/OpenEMR/…/…/…/… is what you need?

Or cover it with ht-access blockage

ideveloptunisia wrote on Wednesday, February 19, 2014:

what I need is to access the file from the patient’s document directory, so I can use that image as a file not as an object. The issue is that an external user does not have the right to access the document directory.

ideveloptunisia wrote on Wednesday, February 19, 2014:

what I need is to access the file from the patient’s document directory, so I can use that image as a file not as an object. The issue is that an external user does not have the right to access the document directory.

yehster wrote on Wednesday, February 19, 2014:

The issue is that an external user does not have the right to access the document directory.
This is BY design for security reasons. Otherwise any random person could hit the webserver and steal protected health information.

There is no good way to do what you want without major code changes to the security model for documents.

ideveloptunisia wrote on Wednesday, February 19, 2014:

what i wanted to know is if I can access a document as a file format without changing the security model.

blankev wrote on Wednesday, February 19, 2014:

As super administrator you can disable read/write permissions of any Directory/Map. Quite a hassle if you can see your documents from within OpenEMR.

ideveloptunisia wrote on Saturday, February 22, 2014:

Hello,

I’ve solved the problem using Base64 Encoding and saving the files in a tmp directory and then delete them when the function finish its work.