Added near correct code for file transfer