writing word file(.doc) using FILE Pointer.

Hello,
I have done programming for transfering file between client & server.
I am Using File Pointer and I am able to transfer text file as well as .gif File.I am reading and writing file in binary mode.
I am sending .doc File and at the server side I am recieving .doc File.And .doc file is made with same size as sent.
But word is finding problem in opening that file.
can any one tell me what migjht be the reason behind this?
I am reading file with fread and writnig with fwrite commmand.

1
2
3
4
5
6
7
8
9
10
	
	if( nFile != NULL )
       {
            numwritten = fwrite( recvbuf, sizeof(char),length, nFile );
            printf( "Wrote %d items\n", numwritten );
            
            fclose(nFile);
        }
      else
       printf("problem in opening file");


Thank You...

amax.
Last edited on
Topic archived. No new replies allowed.