unknown file type reading
i'm trying to make a client-server program using sockets (unix), that allow users to transfer files from client to server.
Im using fopen and fread/fwrite to transfer the files.
The problem is, as i don't know what kind of files the user will transfer, i have no way of knowing how to fopen the files to send!!
- if i open files in binary mode, i won't be able to send .txt files
- if i open files in text mode, i won't be able to send images and other files!!