i have done following modifications in the above code :

Qt Code:
  1. ff.open( IO_Raw | IO_WriteOnly | IO_Append);
  2. stream.writeRawBytes((const char *)recbuf, 1);
To copy to clipboard, switch view to plain text mode 

but still the problem is that the file size is the same i.e. exact number of bytes are getting written but i m not able to read that file.
i.e. if i transfer a pdf file then the pdf reader is not able to read the file
if i transfer a .doc file then openoffice is not able to read the file
if i transfer a .jpg file then picture viewer is not able to read the file

can u please tell now what to do ??