Attached document : view option

1
0
-1

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.

1 answer

1
0
-1

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

Comments

Submitted by kppatel on Tue, 05/20/2014 - 07:11

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

Submitted by Pablo Alonso de... on Tue, 05/27/2014 - 15:11

Hi kppatel,

There is this method in the API (ProcessAPI). 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

Note 'Cheers' is not my name :) is Pablo

Submitted by kppatel on Mon, 06/16/2014 - 12:05

Thanks Pablo , :) apologize for Cheers :P

Notifications