• C0
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

Is it still impossible now? We have a few new options to surpress the output of tags.

  • August 14, 2013
  • Like
  • 0

Is it still impossible now? We have a few new options to surpress the output of tags.

  • August 14, 2013
  • Like
  • 0

Hi,

 

I know there have been some posts about this but none seem to suggest a working answer.

 

I'd like to be able to write a documents body directly to the browser and set the content type so that the contents are treated correctly by the browser.

 

So far I have for an image:-

apex: public string theBody {get; set;} public const(){ Document d = [select body from document limit 1]; theBody = d.EncodingUtil.base64encode(d.body); VF: ... <img src="data:image/jpeg:base64, {!theBody}"/>

...

 

 

Which works ok.

 

For a document e.g. application/msword this approach won't work.

 

I have tried writing out the body directly and body.toString() but none work (even with setting the contentType correctly). If the contentType is set then word just decides to open the data as text inside the document.

 

Has anybody managed this? Is it possible?

 

Thanks for any help.

 

R.