Complete implementation of file sending/receiving.