Sending and receiving files

Hello,

i am creating chat application with the help of openfire. I want to send files between users functionality. I am using spark client at one side and device on other. How it can be achieved.