Urgent Help: Sockets() File Transfer

hello

I am trying to send a file from a client to a server using SOCKETS
hence I send up 3 peices of information

  1. Command [2 bytes]
  2. File Size [4 bytes]
  3. File Data [In sets of 1024 bytes, if file > 1024]
char command[] ="A";
char fileDataBuffer[] ="My Name is bla bla asnd an asdkbgas asd asdk asmbdas sdasd ad w  adw   dada  ad a d  ad a  a d ad a d   ad  ad a d a d  ad a d a d a dadadasda   a d a e kahdi ajshgd hasd jhaf ajshgd kasud  awd , asduayd";
	sendByte.size = sizeof(fileDataBuffer);

int len1,len2,len3;

	if( (len1 =	send(sd, command, sizeof (command), 0)) < 0) {
		perror("command: ");
	}

    if( (len2 =send(sd, sendByte.array, sizeof (sendByte), 0)) < 0 ) {
		perror("file size: ");
	}

	if( (len3 =	send(sd, fileDataBuffer, sizeof (fileDataBuffer), 0)) < 0) {
		perror("data: ");
	}



	//cout << "Bytes: " << sendByte.size << endl;
	cout <<"Bytes transferred successfully are: " << fileDataBuffer <<endl;
	cout <<"Len1 send(): " << len1 <<endl;
	cout <<"Len2 send(): " << len2 <<endl;
	cout <<"Len3 send(): " << len3 <<endl;

//increasing the buffer size of sockets
    setsockopt(s,SOL_SOCKET, SO_RCVBUF, &bufsize, sizeof(bufsize));


  	saun.sin_family = AF_INET;
  	saun.sin_port = htons(4444);
  	saun.sin_addr.s_addr = INADDR_ANY;

    if (bind(s,  (struct  sockaddr *)&saun, sizeof(saun)) < 0) {
        perror("server: bind");
        printf("This Suks\n");
        exit(1);
    }


while(1){

    if (listen(s, 5) < 0)
    {
        perror("server: listen");
        exit(1);
    }

    printf("Send a Request ... \n");
    if ((ns = accept(s, (struct sockaddr *)&saun, &fromlen )) < 0)
    {
        perror("server: accept");
        exit(1);
    }

  recv_len1=recv(ns,&buf,sizeof(buf),0);
           

    printf("Print 1: %i\n", recv_len1);
    printf("Recieved 1:%s\n", buf);


    switch(buf[0])
    {
		case 'A' :
		case 'a': getFileFromClient(s,ns);
			      break;
		    default:
	             printf("ERROR IN SWITCH");

	}

}//end while

   close(s);
   exit(0);
}

void getFileFromClient(s,ns)
{
	int recv_len2;
	int recv_len3;
    int recv_len4;
    int cmdSize = 4;
    char buf2[4];
    int temp =0;
    int test = 0;

	char fileBuffer[BUFFERSZ];
    char fileBuffer2[BUFFERSZ];		 
   do {
          if( (recv_len2=recv(ns,&getData.array,sizeof(getData),0)) < 0) {
          perror("RECV size:");
          }    
    }while(recv_len2 != 4);	 
	 
 while(temp<getData.size)	 {
	 	if( (test = recv(ns,&fileBuffer,sizeof(fileBuffer),0)) < 0) {
	 	 perror("recv() ");
	 	 }	 	
	 	temp+=test;
	 	printf("DATA: %s\n", fileBuffer );
	 }
	 
	 printf("Print 2: %i\n", recv_len2);
	 printf("Recieved 2:%i\n", getData.size);
           
             //write buffer to file
             //writeToFile(fileBuffer, getData.size);     
}

The problem is that when I have the fileDataBuffer[] with data > 1400 bytes. I can successfuly recieve the content of the file. However if the size of that buffer is smaller like 200 bytes or so. The server does not even recieve the second send [the fileSize or bufferSize]. What am i doing wrong ??