How to show a Sample Document as a Downloadable link in an Application Page
I need to implement a scenario where the user can download a sample Document and then fill out the document and upload again.
I am stuck in the part where the sample document can be provided.
The page is an Application page . We use the Page to start a Process instance.
The document should be visible as a Downloadable link to the user.
When the User clicks on the Document link, the sample document is downloaded on the users computer.
What are the possible ways to do that ?
The first thing is is that the Application Page is NOT part of the process and you are therefore unable to process the Bonitasoft way documents. This is as you've already found.
The upload of the document is part of the process and therefore easy enough I'm sure you've worked this out already.
How to do the sample document on the application page though requires you to think outside the confines of Bonitasoft as such and back to basic HTML.
This is how we did it:
Sample documents go into a folder on the server:
NOTE: assuming your server is server:8080/bonita
We then simply create a Custom Widget (applicationSampleFile) with a Empty Controller and one parameter, fileName
the Widget Template has the following code:
Add this to the page, give it the proper file name in the Widgets parameter and viola! All done.
PS: As this reply offers an answer your question, and if you like it, please Mark UP and/or as Resolved.
Thanks, this worked fine.