# Attached document : view option

**URL:** <https://community.ofelia.com/t/attached-document-view-option/4563>\
**Category:** Q&A\
**Created:** [19 May 2014 05:04 UTC](https://community.ofelia.com/t/attached-document-view-option/4563 "2014-05-19T05:04:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kppatel](https://avatars.discourse-cdn.com/v4/letter/k/ecccb3/32.png) [@kppatel](https://community.ofelia.com/u/kppatel)\
**Post date:** [19 May 2014 05:04 UTC](https://community.ofelia.com/t/attached-document-view-option/4563/1 "2014-05-19T05:04:51Z")

</div>

i m using Bonita 6.3 community version .  
i want to view online attached document instead of it download to user’s local drive .  
is it possibly in community  
and how to achive.

---

<div class="post-metadata">

**Author:** ![Pablo\_Alonso\_de\_Lina](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/pablo_alonso_de_lina/32/735_2.png) [@Pablo\_Alonso\_de\_Lina](https://community.ofelia.com/u/Pablo_Alonso_de_Lina)\
**Post date:** [19 May 2014 09:13 UTC](https://community.ofelia.com/t/attached-document-view-option/4563/2 "2014-05-19T09:13:58Z")

</div>

Hi kppatel,

You can get the content of the file ( byte ) using API, and then use javascript in a html widget to show the content as you can do in any webapp

Cheers

---

<div class="post-metadata">

**Author:** ![kppatel](https://avatars.discourse-cdn.com/v4/letter/k/ecccb3/32.png) [@kppatel](https://community.ofelia.com/u/kppatel)\
**Post date:** [20 May 2014 05:11 UTC](https://community.ofelia.com/t/attached-document-view-option/4563/3 "2014-05-20T05:11:45Z")

</div>

Hello Cheers,

Thank you so much for your reply .  
i m totally new in this environment .  
if possibly pl describe in detail .  
it would be appreciable

Thanks again  
kandarp

---

<div class="post-metadata">

**Author:** ![Pablo\_Alonso\_de\_Lina](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/pablo_alonso_de_lina/32/735_2.png) [@Pablo\_Alonso\_de\_Lina](https://community.ofelia.com/u/Pablo_Alonso_de_Lina)\
**Post date:** [27 May 2014 13:11 UTC](https://community.ofelia.com/t/attached-document-view-option/4563/4 "2014-05-27T13:11:56Z")

</div>

Hi kppatel,

There is this method in the API (ProcessAPI). [http://documentation.bonitasoft.com/javadoc/api/6.3/index.html](http://documentation.bonitasoft.com/javadoc/api/6.3/index.html)  
  
byte getDocumentContent(String storageId) throws DocumentNotFoundException

ProcessAPI processAPI = apiAccesor.getProcessAPI(); return processAPI.getDocumentContent(getLastDocument(processInstanceId,"documentName").getContentStorageId());

This will return the byte of the file, with this data in a variable, you will be able to show in html. Only do a quick search on Google (or your fav search engine…) about how to show a byte in html. Be careful about browser compatibility

Here you have more info about docs, may be is useful too  
[http://documentation.bonitasoft.com/handling-documents](http://documentation.bonitasoft.com/handling-documents)

Note ‘Cheers’ is not my name 🙂 is Pablo

---

<div class="post-metadata">

**Author:** ![kppatel](https://avatars.discourse-cdn.com/v4/letter/k/ecccb3/32.png) [@kppatel](https://community.ofelia.com/u/kppatel)\
**Post date:** [16 June 2014 10:05 UTC](https://community.ofelia.com/t/attached-document-view-option/4563/5 "2014-06-16T10:05:37Z")

</div>

Thanks Pablo ,  
🙂  
apologize for Cheers 😛
