I want to fire action on file (attachment) : button (upload, update)

I m using Bonita community version .
i add field in form : file
i can browse and upload file and as well modify file
but i want to add some variable : like if modify clicked : variable : true

same for upload . if file is upload variable should be true .
how can i achieve .