PDF Viewer? Uploaded files / documents

Hello :slight_smile:

Just looking through forums etc and thought I would ask

Is there a PDF and/or Word viewer for SuiteCRM?
We have documents and files being uploaded that we do not want to be downloaded, just viewed

Thanks

In the root directory,
change the following excerpt from the file “download.php”

 header("Content-type: application/octet-stream");

TO

 header("Content-type: application/pdf"); 

AND

header("Content-Disposition: attachment; filename=\"".$name."\";");

TO

header("Content-Disposition: Inline; filename=\"".$name."\";");

ATTENTION!
I’ve done this procedure, BUT it’s OK to validate the input file type. not our case. Every upload is validated and as soon as it is sent files, doc, pdf, opendocument, images, spreadsheets and presentations.
because you can run a malicious file in php for example to list, download and change the contents of your server.
IF YOU DO NOT INITIATE FILE TYPE VALIDATION. YOU WILL HAVE A RISK OF EXPOSURE TO INTENDED USER ATTACKS.

source:
https://www.suitecrm.com/forum/suitecrm-7-0-discussion/8441-open-attachments-in-a-new-browser-window

2 Likes