PHP Warning: mime_content_type(pdf): Failed to open stream: No such file or directory in /Users/jmlockl2/Desktop/openemr/library/sanitize.inc.php on line 112
Warning: mime_content_type(pdf): Failed to open stream: No such file or directory in /Users/jmlockl2/Desktop/openemr/library/sanitize.inc.php on line 112
OpenEMR API Error: Attempt to upload unsecure patient document was declined
I am not quite sure what I should be including in the $fileData array. Any help appreciated!
hi @lumbee, you need to check on a couple settings
// Ensure filetype is allowed
if ($GLOBALS['secure_upload'] && !isWhiteFile($fileData["tmp_name"])) {
error_log("OpenEMR API Error: Attempt to upload unsecure patient document was declined");
return false;
}
PHP Warning: mime_content_type(pdf): Failed to open stream: No such file or directory in /Users/jmlockl2/Desktop/openemr/library/sanitize.inc.php on line 112
Warning: mime_content_type(pdf): Failed to open stream: No such file or directory in /Users/jmlockl2/Desktop/openemr/library/sanitize.inc.php on line 112
OpenEMR API Error: Attempt to upload unsecure patient document was declined
I’m actually on a custom branch so it must be something going on locally with that branch. Thanks for helping me sort through this. I’ll dig deeper into my local branch to see if I can figure things out.
(base) jmlockl2@C02ZM744MD6M custom % php sand_box.php
PHP Warning: Undefined array key “provider_id” in /Users/jmlockl2/Sites/crisisprep-6/src/Services/EncounterService.php on line 328
Warning: Undefined array key "provider_id" in /Users/jmlockl2/Sites/crisisprep-6/src/Services/EncounterService.php on line 328
PHP Warning: Undefined array key "authUser" in /Users/jmlockl2/Sites/crisisprep-6/library/forms.inc on line 59
Warning: Undefined array key "authUser" in /Users/jmlockl2/Sites/crisisprep-6/library/forms.inc on line 59
PHP Warning: Undefined array key "authProvider" in /Users/jmlockl2/Sites/crisisprep-6/library/forms.inc on line 63
Warning: Undefined array key "authProvider" in /Users/jmlockl2/Sites/crisisprep-6/library/forms.inc on line 63
PHP Warning: mime_content_type(application/pdf): Failed to open stream: No such file or directory in /Users/jmlockl2/Sites/crisisprep-6/library/sanitize.inc.php on line 112
Warning: mime_content_type(application/pdf): Failed to open stream: No such file or directory in /Users/jmlockl2/Sites/crisisprep-6/library/sanitize.inc.php on line 112
OpenEMR API Error: Attempt to upload unsecure patient document was declined
object(OpenEMR\Services\DocumentService)#319 (0) {
}
Wondering if this could be file perms/rights issue to the documents folder in sites/defaults/documents? Here are the perms there: drwxr-xr-x 17 _www _www 544 Aug 25 13:07 documents
@stephenwaite I am thinking that is the issue also. Any thoughts on that? Is the permissions for the documents folder enough, or is there a specific config option I need to add to apache?
…actually thinking about it more, it would not be an apache issue since this is failing while running my script. Adding a document via the app (in the web browser) works fine. So maybe its a PHP config issue