I am trying to us the insertAtPath() method in src/Services/DocumentService.php to create/upload a new pdf file. Here is my code:
$fileData = array("name" => "temp_name", "tmp_name" => "pdf");
$path = "test.pdf";
$documentService->insertAtPath($new_patient['pid'], $path, $fileData);
…and here is the error I’m getting:
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!