I have a .doc type attachment , Attachment contains some images and text . I want to show all content of this attachment on vf page. I am able to show pdf, images type attachment preview on vf page , issue is only with (.doc, docx, .ppt ) file. it downloads the attachment instead of showing in new tab.
If attachment is 'attach' which is document file and it may contain images and text. If I convert body to string like this and show string on vf page in outputtext string attachbody = attach.body.tostring(); I am getting error not UTF-8 type string,
if I use this code show string on vf page in outputtext string attachbody = base64Encode(attach.body); I am getting exceed 135 kb error