tcp: Add a function for transmitting files