Files, unlike strings and ints (any primitive type for that matter) are not serializable.
So if you want to send a file via a socket (may the protocol be UDP or TCP) you are going to have to send...