Can I convert a file in a string and back in C?

I have the following function that will send a tosend string using UDP protocol (knowing ip and port of the receiver).

int snd_string(char *tosend, uint16_t rcvport, char *rcvip);

The tosend string can be really long: snd_string will divide it in several chunks and send each datagram separately using a reliable application level protocol.

I want to use the same function in order to send a file (whether it be a text file or a binary file). Is there a way to convert the file in a string and the received string back to the original file?