Although this subject is out of topic (this question is actually about sockets and not tkinter), not asked correctly (see how to ask), and possibly a duplicate of Send a file through sockets in Python , here is a short description of what you should have done for the sake of others.
Generally speaking, transferring files is a broad subject to deal with, from compression, file transfer, checksums, etc. We'll concentrate on how to transfer data in general between two computers using sockets
because I see that this is your intention.
Depending on your implementation, you should send a request for the other user for a file transfer. Then, if accepted (acceptance/rejection should be a response from the other user), start transferring the file.
In the first step, just send an header that describes the file transfer (file name, size, etc.) Then, when accepted, you send a bytes stream of the content.
You can read files as bytes with open(file,'rb')
and open(file,'wb')
for read/write, respectively.
Its a good practice to communicate with headers for metadata, check availability, manage balance, etc.
Note that using socket is low-level interface for data transfer. I wouldn't reinvent; I would learn by examples. See Sending a file over TCP sockets in Python post that shown a nice concise code that transfer files. The solution for his problem (termination of a transfer) is given in the answers of that post, but the code is generally OK. Few more minutes on Google search will result with explained tutorials.
Have the best luck with you application!