+ Start a Discussion

displaying document content in lightning componentt


I want to display document content in lightning component, how should i do it ? Please suggest some work around. Thank you.
NagendraNagendra (Salesforce Developers) 
Hi KMK91,

If I understand your question correctly I would suggest you please check with below link from the stack exchange community with a similar discussion which might help you. Please let us know if this helps.

Kindly mark this as solved if the reply was helpful.

Thank you Nagendra and Shruti, I figered it out. Below is the code which i am using for getting the content from a notepad.
Document d = [Select body, bodyLength, ContentType, Url from Document where name =: documentName]; 
        Blob b = d.body; 
        //String s = b.toString(); 
        HttpRequest tmp = new HttpRequest();
        String value = tmp.getBody(); 

But it is working for only Notepad, if i am trying to fetch the content of word or pdf files, its displaying in special characters.