Binary file transfer over Socket using TCP
问题 I am working on a binary file transfer program in which the client has to upload a file to server. For this case, I need to send the file name first and file content second. But this is not feasible for me. Lets see the code: // Client-side code to send file name void sendFileName( int sd, /*Socket Descriptor*/ char *fname) /*Array Containing the file name */ { int n , byteswritten=0 , written ; char buffer[1024]; strcpy(buffer , fname); n=strlen(buffer); while (byteswritten<n) { written