Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to view Word Documents in browser

Edwin TJun 15 2015 — edited Jun 15 2015

We are using the apex_util.get_blob_file_src() function to display documents in a webpage. Images, and PDF documents work well, but Word documents are simply downloaded. Is there a way to view them in the browser without the automatic download?

Here's an example if the code snippet we are using for word documents;

.....

IF P1000_MIME_TYPE = 'application/msword' THEN

htp.prn('

<div style="width:900px;height:900px;">

<embed height="100%" width="100%" name="embed_content" src=""'

|| apex_util.get_blob_file_src('P1000_DOCUEMENT', P1000_ID, null, 'inline')||

'" type="application/msword" />

</div>

');

ELSIF

:P1000_MIME_TYPE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' THEN

htp.prn('

<div style="width:900px;height:900px;">

<embed height="100%" width="100%" name="embed_content" src=""'

|| apex_util.get_blob_file_src('P1000_DOCUEMNT', P1000_ID, null, 'inline')||

'" type="application/vnd.openxmlformats-officedocument.wordprocessingml.document" />

</div>

');

END IF; ...... REST OF CODE

See image from example in Chrome below. Other browsers have somewhat similar results.

word_doc example.JPG

Thank you!

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 13 2015
Added on Jun 15 2015
1 comment
590 views