I think it would be easier if u use a separate protocol, your own protocol... like Indy:
http://www.indyproject.org/indy.html
It would make it easier for you...
Indy is "an open source internet component suite comprised of popular internet protocols written in Delphi and based on blocking sockets."
So, you could intercept a file transfer and send it through Indy. Of course, the other person must have the plugin, too.