title: Only first byte is received when sending string from client to server
body: <p>I made a client/server program and am sending a file from the client to the server.</p>
  
  <p>Here is a piece of the code:</p>
  
  <p>Client side:</p>
  
  <pre><code>FILE *f = fopen("file.txt" ,"r");
  size_t bytes = 0;
  while(bytes = fread(buffer ,sizeof(char) , sizeof(buffer) ,f)&gt;0)
  {printf("buff%s\n" , buffer);
  send(sockfd ,buffer ,bytes , 0);
  } 
  fclose(f);
    printf("%s\n",buffer);
  </code></pre>
  
  <p>Server side:</p>
  
  <pre><code>FILE *f = fopen("file1.txt" ,"w");
  while(bytes = recv(newsockfd ,buffer , sizeof(buffer) ,0)&gt;0)
  {
  printf("bytes%d" , bytes);
  fwrite(buffer,sizeof(char) ,bytes , f);
  }
  bytes = recv(newsockfd ,buffer , sizeof(buffer) ,0);
  printf("bytessss%d" , bytes);
    fclose(f);  
       printf("Here is the message: %s\n",buffer);
       close(newsockfd);
  </code></pre>
  
  <p>But when I send it to the server, the server makes a file and stores only the first byte, eg when I send "hi whats up ", the server only stores "h".</p>