04-21-2017 08:53 AM
Made a process to upload a file.
Also added a execution listener to the process.
I want to know how to retrieve the uploaded file by execution listener
Below is my code for execution listener
I want to know how to get that file from database.
I want to know about java libraries to access file from database
Thank you in advance
04-24-2017 08:49 AM
If you have an attachment ID (from when you uploaded the attachment), then you can use the taskService
taskService.getAttachment(attachmentId);
If this returns not null, then you can get the attachment content using:
InputStream attachmentStream = taskService.getAttachmentContent(attachmentId);
Hope this is what you were looking for,
Greg
04-25-2017 02:13 AM
Hi,
Thank you
I may need more help regarding this as I am new to this.
Can you please please provide the full implementation of this.
I am doing something like this
Also how do you get the attachment id provide you know the form id
TaskService taskService = processEngine.getTaskService();
if(taskService.getAttachment("uploadurl")!=null){
InputStream attachmentStream = taskService.getAttachmentContent(attachmentId);
}
Here uploadurl is the form id for file upload
I think I am not doing it right
Please help
Explore our Alfresco products with the links below. Use labels to filter content by product module.