That seems a wee dangerous, should your connection slow temporarily.I specify a timeout time of 1 second... if it hits that, then i break out of the receieve loop.
If your situation is simple, you might not want to bother with the complexity of select() - just keep using recv(). For blocking sockets (the default) recv() will return 0 when the connection is closed, and -1 on any error. (Connection loss, etc.) Having the server close the connection after transfer seems it would suffice.
Should you need to keep the connection open for other data, then you should send the file's size before the file itself, so the client knows how much to recv.