Patient document stored as pdf (problem)

markthepharaoh wrote on Tuesday, October 18, 2011:

Hi, I get the garbage below when I try to open pdf file from patient documents.  If i save the file and I give it a pdf extention, I can open it.  I upgraded from 3.2 to 4.1.0 (2)?  I appreciate your  help.  thanks.

%PDF-1.3 3 0 obj << /Type /XObject /Subtype /Image /Filter /DCTDecode /Width 2480 /Height 3229 /Length 793683 /BitsPerComponent 8 /ColorSpace /DeviceRGB >> stream ÿØÿàJFIF,,ÿþLEAD Technologies Inc. V1.01ÿÛ„ aa a "$$“!!&+7.&(4)!!0A049:=>=%.CHC<=; =”" ;’!’;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ÿÄ¢����������a="" �������a="" ���}�!1aqaa"q2‘¡#b±ÁrÑð$3br‚="" %&’()*456789:cdefghijstuvwxyzcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤

bradymiller wrote on Tuesday, October 18, 2011:

Hi,

Can you clarify:
Is it working fine if the filename has a pdf extension?

-brady

markthepharaoh wrote on Tuesday, October 18, 2011:

Brady, the files have the extension pdf already and they were working fine before the upgrade. after the upgrade If I try to open it I get the garbage. in order to see the file content, I have to right click  and choose “Save  Link As” and what I get is a dialog box that has Save AS: controller.php as the file name and what I do is add .pdf and save the file to the desktop and then go to the desktop and open it.  Thanks for your help.

yehster wrote on Tuesday, October 18, 2011:

I wonder if the controller.php needs to be changed so that it specifies a mime type (e.g. application/pdf) so that the browser processes it as PDF instead of thinking it’s html.

markthepharaoh wrote on Wednesday, October 19, 2011:

I tried to look at controller.php…. but it was empty

@yehster what files do you suggest i look at? that would have the mime specifications that affect pdf/tiff/“documents”   display/download (stream file types)???

markthepharaoh wrote on Wednesday, October 19, 2011:

To describe the problem more adequately its like a site where it steams the mp3 in browser but its not necessary plugin related but rather instead of prompting you to download it starts streaming a direct link and i know its not the local firefox settings because it has the same behavior in Internet explorer and chrome… its a mime submission behavior.

bradymiller wrote on Thursday, October 20, 2011:

Hi,

Can’t confirm this for new pdf documents on 4.1.0(2) or 4.1.1.

Are you getting this for documents imported after the upgrade or only for documents before the upgrade?

If indeed documents imported after the upgrade are working, while those before the upgrade are not, then will be useful to compare the entries of them in ‘documents’ mysql table to see if any differences (especially the mimetype column).

Even if it’s not working for documents imported after the upgrade also, still curious what is being populated in the mimetype columns.

-brady

markthepharaoh wrote on Friday, October 21, 2011:

Hi Brady

The system is running the following:
xampp 1.73
php 5.31
mySQL 5.1.41
Pear 1.90
and I running windows 7 home edition

I have upgraded to 4.1.0(2). and the problem is happening with all files that were stored before or after the upgrade.  I have looked at the database under documents and the mime type has the different correct extentions as the files were stored, pdf or tif? Do you think any of the above programs needs to be updated? Thank you for your help.

Mark

bradymiller wrote on Friday, October 21, 2011:

Hi Mark,

Think I remember this coming up for somebody in the past and ended up being a acrobat setting issue (http://www.bnl.gov/itd/webapps/pdf_help.asp). What happens if you upload/view a document in the 4.1.0(2) demo here:
http://open-emr.org/wiki/index.php/Development_4.1.0_Demo

-brady

markthepharaoh wrote on Saturday, October 22, 2011:

Hey Brady,

I logged into the Demo to test it out…. It works fine, I dont think it’s pdf specific because it has similar behaviours with other file types such as TIFF and png… I think its a feed/streaming issue with whatever code handles downloading from the server… Because I checked to see if upload works and the files are intact on the server but upon retrieval they show up and are fed incorrectly…

markthepharaoh wrote on Saturday, October 22, 2011:

http://i54.tinypic.com/r0wozt.png

here you go brady have a look….

markthepharaoh wrote on Monday, October 24, 2011:

Hey Brady,

Do you think upgrading from 3.2 to 4.1.0(2) directly, skipping 4.0 would have caused such pdf, tiff problem? Thanks.

bradymiller wrote on Monday, October 24, 2011:

Hi,

There were errors with this stuff around 3.0-3.2 as I recall, but were fixed by 4.0. So, not obvious why upgrading it would break this. Also, one more thing to do that can sometimes stop weird behavior within the smarty scripts is to remove all files and folders from the following directory:
openemr/interface/main/calendar/modules/PostCalendar/pntemplates/compiled/

-brady

markthepharaoh wrote on Tuesday, October 25, 2011:

Thanks Brady ! I reinstalled the software. I upgraded 3.2 to 4.0 to 4.1 and now is working fine so far. Thanks again for your help.