cancel
Showing results for 
Search instead for 
Did you mean: 

Better Approach to Store pdf and Images

shivtiwari
Champ in-the-making
Champ in-the-making
Dear Friends,

In my application, there is a requirement to store uploaded image from client machine.
Which is the better way out of 2
1:- Storing files in activity database
2:- Storing files on Server machine and the path for same in Activity database


Also is their any way to load this image lazily in Application
6 REPLIES 6

frederikherema1
Star Contributor
Star Contributor
Depends on how many images you want to see stored and if you want to back the data up. In case you store them in Activiti, you only need to create backups for the DB, no additional FS copies need to be created. However, if you have a large amount of files (and large files), it's not ideal to store all these in the DB, as it will grow and grow, making the ACT_GE_BYTEARRAY_ table huge.

What do you mean by lazily loading the image in the application? I presume you're wondering if you can request the process-variables map WITHOUT having the full image byte-array initialized in it? That's currently not possible, getting a binary variable get's the full image/byte-array.

A workaround could be to use the Attachment (see taskService), which allows you to add binary attachments to tasks/processes and fetch the actual binary content independently from the Attachment entity.

Thanks frederikheremans, for the input.

Requirement is :-
1:- Task are assigned to group of people
2:- each one of them will perform some activity and as a result, Object(with all inputs) will get stored in activity along with 1 or 2 image
3:- Approver will see all inputs along with image/pdf

My Question is:
1:- Whats the better approach a:- store image/pdf at server and their path in activity b:- store image/pdf in activity
2:- If user1 submits task containing image to userb and userb to userc then how many attachemtns are created in activity database
    i.e. do we have seperate copy for each user or just single copy which is referd by all
3:- Archieve data on daily/ basis is good approach???

Thanks frederikheremans, for the input.

Requirement is :-
1:- Task are assigned to group of people
2:- each one of them will perform some activity and as a result, Object(with all inputs) will get stored in activity along with 1 or 2 image
3:- Approver will see all inputs along with image/pdf

My Question is:
1:- Whats the better approach a:- store image/pdf at server and their path in activity b:- store image/pdf in activity
2:- If user1 submits task containing image to userb and userb to userc then how many attachemtns are created in activity database
    i.e. do we have seperate copy for each user or just single copy which is referd by all
3:- Archieve data on daily/ basis is good approach???

frederikherema1
Star Contributor
Star Contributor
1. Really depends on the amount of attachment. I've already explained the benefits of both approaches above.

2. Only one attachment will be created in the DB. Activiti explorer will show this ONE attachment for all tasks in that process.

Thanks frederikheremans

Can you suggest any opensource document management system which can easily get integrated with activiti.
Requirement is same:
1:- We want our Data(Image/pdf) to be stored/retrived etc.
2:- Also we have to maintain version for each document as it gets updated by different users

Currently we are using Activiti 5.11

jbarrez
Star Contributor
Star Contributor
Well, obviously since Activiti is sponsored by Alfresco, I would recommend it (http://www.alfresco.com/) 😉